Moving all the theme files out of the theme directory
This commit is contained in:
parent
23369f4ace
commit
3006bff575
40 changed files with 477 additions and 11 deletions
42
webpack/base.config.js
Normal file
42
webpack/base.config.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
const path = require('path');
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../src'),
|
||||
plugins: [new MiniCssExtractPlugin()],
|
||||
entry: {
|
||||
app: ['./js/index.js']
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../static/dist')
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(css|scss)$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
'css-loader',
|
||||
{
|
||||
loader: 'postcss-loader'
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: 'babel-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
optimization: {
|
||||
minimizer: [
|
||||
`...`,
|
||||
new CssMinimizerPlugin(),
|
||||
],
|
||||
},
|
||||
}
|
||||
8
webpack/dev.config.js
Normal file
8
webpack/dev.config.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
const baseConfig = require('./base.config.js');
|
||||
const { merge } = require('webpack-merge');
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'eval-source-map',
|
||||
watch: true
|
||||
});
|
||||
11
webpack/prod.config.js
Normal file
11
webpack/prod.config.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
const baseConfig = require('./base.config.js');
|
||||
const { merge } = require('webpack-merge');
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'production',
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [new TerserPlugin()],
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue