codebandits / react-app-rewire-css-modules

MIT License
69 stars 51 forks source link

SyntaxError: Unexpected token ... #13

Closed nsuedu closed 5 years ago

nsuedu commented 6 years ago

D:\ZX_TG\CODE\frontEnd\metadata_management\node_modules\react-app-rewire-less-modules\index.js:18 ...rule, ^^^

SyntaxError: Unexpected token ... at createScript (vm.js:74:10) at Object.runInThisContext (vm.js:116:10) at Module._compile (module.js:533:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object. (D:\ZX_TG\CODE\frontEnd\metadata_management\config-overrides.js:2:20)

--------------------------------------config-overrides.js const { injectBabelPlugin } = require('react-app-rewired'); const rewireLess = require('react-app-rewire-less-modules');

module.exports = function override(config, env) {

config = injectBabelPlugin(['import', { libraryName: 'antd', style: true }], config);
config = rewireLess.withLoaderOptions(
    {
        modifyVars: { "@primary-color": "#1890ff" },
    }

)(config, env);

return config;

};

lnhrdt commented 5 years ago

Closing this issue and archiving this project in favor of Create React App's native support for CSS Modules introduced in v2.