Resolve "Replace Gulp with Webpack"
This commit is contained in:
parent
16230a11f3
commit
b28d42b97b
18 changed files with 1673 additions and 1863 deletions
33
webpack.common.babel.js
Normal file
33
webpack.common.babel.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { resolve } from 'path';
|
||||
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||
|
||||
export default {
|
||||
entry: {
|
||||
main: ['./src/newsreader/js/index.js', './src/newsreader/scss/index.scss'],
|
||||
},
|
||||
output: {
|
||||
path: resolve(__dirname, 'src', 'newsreader', 'static', 'js'),
|
||||
filename: '[name].bundle.js',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use: { loader: 'babel-loader' },
|
||||
},
|
||||
{
|
||||
test: /\.(sass|scss)$/,
|
||||
use: [{ loader: MiniCssExtractPlugin.loader }, 'css-loader', 'sass-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: './src/newsreader/static/css/[name].css',
|
||||
allChunks: true,
|
||||
}),
|
||||
new CleanWebpackPlugin(),
|
||||
],
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue