You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When l yarn start server.js throw error, such as this:
(function (exports, require, module, __filename, __dirname) { @import './themes/default';
Here is my client webpackConfig
`const ExtractTextPlugin = require("extract-text-webpack-plugin");
const antdTheme = require("../antdTheme"); // <- Include variables to override antd theme
const extractLess = new ExtractTextPlugin({
filename: "static/css/[name].[contenthash].css",
disable: process.env.NODE_ENV === "development" // disable this during development
});
When l yarn start server.js throw error, such as this:
(function (exports, require, module, __filename, __dirname) { @import './themes/default';
Here is my client webpackConfig
`const ExtractTextPlugin = require("extract-text-webpack-plugin");
const antdTheme = require("../antdTheme"); // <- Include variables to override antd theme
const extractLess = new ExtractTextPlugin({
filename: "static/css/[name].[contenthash].css",
disable: process.env.NODE_ENV === "development" // disable this during development
});
module.exports = (config, webpack) => ({
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
plugins: [["import", { libraryName: "antd", style: true }]]
}
},
{
test: /.less$/,
// use the ExtractTextPlugin instance
use: extractLess.extract({
use: [
{
loader: "style-loader"
},
{
loader: "css-loader"
},
{
loader: "less-loader",
options: {
modifyVars: antdTheme
}
}
],
// use style-loader in development
fallback: "style-loader"
})
}
]
},
plugins: [
...config.plugins,
extractLess // <- Add the ExtractTextPlugin instance here
]
});`
Here is my server's webConfig.
module.exports = (config, webpack) => ({ ...config, module: { ...config.module, rules: [...config.module.rules], }, plugins: [ ...config.plugins, new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, }), ], })
Here is mine razzle.config.js;
module.exports = { modify: (config, { target, dev }, webpack) => { const targetName = target === 'node' ? 'server' : 'client' return require(
./webpack/${targetName})(config, webpack) }, }
The text was updated successfully, but these errors were encountered: