Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// This line allows us to use `@import "~/scss/..."` in our app:
config.resolve.alias['/scss'] = SCSS_DIR
}
if (isDev && isClient && config.module) {
// Enabling eslint:
config.module.rules.push({
'enforce': 'pre',
'test': /\.(js|ts|vue)$/u,
'loader': 'eslint-loader',
'exclude': /(node_modules)/u,
})
if (config.plugins) {
// Enabling stylelint:
config.plugins.push(new StylelintWebpackPlugin({
'files': 'client/**/*.{vue,scss,css}',
}))
}
}
},
},
config.module.rules.push({
test: /\.lazy\.(scss|css)$/,
use: [
{
loader: 'style-loader',
options: {
injectType: 'lazyStyleTag',
},
},
'css-loader',
'sass-loader',
],
});
config.plugins.push(
new StyleLintPlugin({
syntax: 'scss',
context: path.join(__dirname, dir),
}),
);
config.plugins.push(
new WebpackNotifierPlugin({
alwaysNotify: true,
emoji: true,
}),
);
config.plugins.push(new PrismLanguageGenerationPlugin());
config.plugins.push(
new DependencyExtractionWebpackPlugin({
outputFormat: 'json',
combineAssets: true,
combinedOutputFile: `wp-assets${isProd(state) ? '.min' : ''}.json`,
new EnvironmentPlugin({
NODE_ENV: 'development',
}),
new DefinePlugin({
__DEV__: isDev,
__WECHAT__: isWechat,
__ALIPAY__: isAlipay,
wx: isWechat ? 'wx' : 'my',
my: isWechat ? 'wx' : 'my',
}),
new WXAppWebpackPlugin({
clear: !isDev,
}),
new optimize.ModuleConcatenationPlugin(),
new IgnorePlugin(/vertx/),
shouldLint && new StylelintPlugin(),
min && new MinifyPlugin(),
new CopyPlugin(copyPatterns, { context: srcDir }),
].filter(Boolean),
devtool: isDev ? 'source-map' : false,
resolve: {
modules: [resolve(__dirname, 'src'), 'node_modules'],
},
watchOptions: {
ignored: /dist|manifest/,
aggregateTimeout: 300,
},
};
};