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

less-loader for ant-design #340

Open
louiskhenghao opened this issue Apr 23, 2018 · 0 comments
Open

less-loader for ant-design #340

louiskhenghao opened this issue Apr 23, 2018 · 0 comments

Comments

@louiskhenghao
Copy link

louiskhenghao commented Apr 23, 2018

Hi guys,

Have anyone of you tried to implement ant-design before? (i am new to webpack..)
i have encounter some issue regarding less...
And this is the error i got...

/Projects/webapp/node_modules/antd/lib/style/index.less:1
(function (exports, require, module, __filename, __dirname) { @import "./themes/default";
                                                              ^
SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Projects/webapp/node_modules/antd/lib/button/style/index.js:3:1)

webpack.config.js
Rule i have added to webpack and i actually refer this link and this link

module: {
    rules: [
      {
        test: /\.less$/,
        use: [
          { loader: "style-loader" },
          { loader: "css-loader" },
          { loader: "less-loader" }
        ]
      }
    ]
}

Please share if you have any clue of this 😄
Tqvm

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

1 participant