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

Adapt code to webpack 4 and less 3 #7

Open
prncc opened this issue Mar 8, 2018 · 5 comments
Open

Adapt code to webpack 4 and less 3 #7

prncc opened this issue Mar 8, 2018 · 5 comments

Comments

@prncc
Copy link
Contributor

prncc commented Mar 8, 2018

Currently the code assumes webpack 3 and less 2, and some changes will need to be made to avoid warnings and errors.

@prncc prncc self-assigned this Mar 8, 2018
@prncc prncc added the ready label Mar 8, 2018
@prncc
Copy link
Contributor Author

prncc commented Mar 10, 2018

This should work now, after adding javascriptEnabled: trueto less options and checking for compiler.hooks in the plugin, but it should be tested.

@prncc prncc added month and removed ready labels Mar 15, 2018
@prncc prncc removed the month label Apr 18, 2018
@prncc
Copy link
Contributor Author

prncc commented Jun 2, 2018

Also requires at least fixing #33

@antenando
Copy link

I'm trying with

    "next": "^7.0.0-canary.0",
    "@zeit/next-css": "^0.2.1-canary.2",
    "@zeit/next-less": "^0.3.1-canary.2",
    "@zeit/next-sass": "^0.2.1-canary.2",

but wrapping the loaders with your plugin manually over next.config.js ... could not get it to work though. I think mainly because it is webpack 4 after all.

Let us know if we can help to release a version for webpack 4

Much obliged, your plugin is great!

@prncc
Copy link
Contributor Author

prncc commented Aug 29, 2018

Hi @antenando,

I think this should mostly work with Webpack 4 already, and the present issue is writing some tests and examples.

In your case, unfortunately, the plugin won't work. This plugin creates a custom version of less-loader and sass-loader to do its job, so using it with any other loaders won't do anything. If you'd like to extend the functionality, though, please make a separate issue and we can discuss the specifics.

@devil9108
Copy link

Getting the below issue after adding the antd-scss-theme-plugin to our project.
we are using wepack: 4.40.2, less: 3.10.3, less-loader: 5.0.0, antd: 3.23.4

At first got the below error

`position: absolute;
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;`

After adding strictMath: true above error resolved.

After that got the below error

 &-loading-icon {
      .iconfont-size-under-12px(10px);
    ^
Error evaluating function `unit`: the first argument to unit must be a number. Have you forgotten parenthesis?
      in D:\Phoenix-spa\node_modules\antd\lib\cascader\style\index.less (line 217, column 6)

Its not resolving. Any one please help me on this.

At present my plugin code is like below

AntdScssThemePlugin.themify({
	loader: 'less-loader',
	options: {
		javascriptEnabled: true,
		strictMath: true,
		sourceMap: isEnvProduction && shouldUseSourceMap
	}
})

@prncc prncc removed their assignment Nov 12, 2022
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

3 participants