Skip to content

Instantly share code, notes, and snippets.

@objectfoo
Created August 9, 2019 04:19
Show Gist options
  • Select an option

  • Save objectfoo/e55ebeddcea7983ae50b84e93f77aa0b to your computer and use it in GitHub Desktop.

Select an option

Save objectfoo/e55ebeddcea7983ae50b84e93f77aa0b to your computer and use it in GitHub Desktop.
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = function (env, argv) {
const isProduction = argv.mode === "production"
const plugins = [];
plugins.push(
new MiniCssExtractPlugin({
filename: 'style.css',
ignoreOrder: false
})
)
return {
entry: {
script: path.resolve(__dirname, 'src/index.js')
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
plugins,
module: {
rules: [
{
test: /\.less$/,
use: [
{ loader: MiniCssExtractPlugin.loader },
'css-loader',
'clean-css-loader',
'less-loader'
]
}
]
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment