61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
|
const path = require('path')
|
||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||
|
const CopyPlugin = require('copy-webpack-plugin');
|
||
|
|
||
|
module.exports = {
|
||
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
||
|
entry: [
|
||
|
'./src/index.js',
|
||
|
'./scss/style.scss'
|
||
|
],
|
||
|
plugins: [
|
||
|
new MiniCssExtractPlugin(),
|
||
|
new CopyPlugin({
|
||
|
patterns: [
|
||
|
{ from: './html/', to: '' },
|
||
|
//{ from: './images/', to: 'images' },
|
||
|
],
|
||
|
}),
|
||
|
],
|
||
|
devtool: process.env.NODE_ENV === 'production' ? false : 'inline-source-map',
|
||
|
performance: {
|
||
|
maxEntrypointSize: 900000,
|
||
|
maxAssetSize: 900000
|
||
|
},
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.ink$/,
|
||
|
use: require.resolve('inklecate-loader'),
|
||
|
},
|
||
|
{
|
||
|
test: /\.m?js$/,
|
||
|
exclude: /(node_modules)/,
|
||
|
use: {
|
||
|
loader: 'babel-loader',
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
test: /\.s[ac]ss$/i,
|
||
|
use: [
|
||
|
MiniCssExtractPlugin.loader,
|
||
|
// Translates CSS into CommonJS
|
||
|
'css-loader',
|
||
|
'postcss-loader',
|
||
|
// Compiles Sass to CSS
|
||
|
'sass-loader'
|
||
|
]
|
||
|
},
|
||
|
]
|
||
|
},
|
||
|
output: {
|
||
|
path: path.resolve(__dirname, 'build')
|
||
|
},
|
||
|
watchOptions: {
|
||
|
// for some systems, watching many files can result in a lot of CPU or memory usage
|
||
|
// https://webpack.js.org/configuration/watch/#watchoptionsignored
|
||
|
// don't use this pattern, if you have a monorepo with linked packages
|
||
|
ignored: /node_modules/,
|
||
|
},
|
||
|
}
|