Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type '"replace"' is not assignable to type 'CustomizeRule'. #147

Closed
henrypoon opened this issue Sep 9, 2020 · 2 comments
Closed

Type '"replace"' is not assignable to type 'CustomizeRule'. #147

henrypoon opened this issue Sep 9, 2020 · 2 comments

Comments

@henrypoon
Copy link

henrypoon commented Sep 9, 2020

Issue

TS would complain "string" is not assignable to type 'CustomizeRule' when I write webpack config file into TS file. Should we export 'CustomizeRule' to allow users to import this enum?

☑️ Using updated webpack-merge
☑️ Using NodeJS v12.16.3, ts-node v9.0.0
☑️ Using MacOS

webpack.config.ts

export default mergeWithCustomize({
    customizeObject: customizeObject({
        entry: 'replace',
        output: 'append',
    })
})(webpackConfig, themeConfig);

image

Propose
Export 'CustomizeRule' and users could import it
e.g.

export default mergeWithCustomize({
    customizeObject: customizeObject({
        entry: CustomizeRule.Replace,
        output: CustomizeRule.Append,
    })
})(webpackConfig, themeConfig);
@bebraw
Copy link
Member

bebraw commented Sep 9, 2020

@henrypoon Thanks for bringing this up! I'll expose CustomizeRule.

I guess another option would be to support simply strings instead of token.

@bebraw
Copy link
Member

bebraw commented Sep 9, 2020

Solved in c4e293b . I expose CustomizeRule now.

@bebraw bebraw closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants