Update dependencies and add blog

This commit is contained in:
Corentin 2021-10-07 09:02:43 +09:00
commit 7a8fb3449d
22 changed files with 948 additions and 332 deletions

View file

@ -1,7 +1,4 @@
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin")
const config = require('./webpack.base.js');
module.exports = Object.assign(
@ -23,47 +20,14 @@ module.exports = Object.assign(
inferno: require.resolve('inferno/dist/index.dev.esm.js')
}
},
plugins: [
plugins: config.plugins.concat([
new webpack.DefinePlugin(
{
'process.env':
{
'DEBUG': true
} // set a DEBUG flag that can be used in the scripts
}),
new CopyPlugin([
{from: 'index.html'},
{from: 'robot.txt'},
{from: 'src/lang', to: 'lang'},
{from: 'assets/public', to: 'assets'}
]),
new CompressionPlugin(
{
filename: "[path].gz[query]",
algorithm: "gzip",
test: [/\.js/, /\.svg/],
threshold: 1000
})
],
// webpack-dev-server configuration
devServer:
{
contentBase: path.join(__dirname),
compress: true,
port: 8080,
// Not elegant way to get rid of the gzip path in index.html
proxy:
{
'/$':
{
target: 'http://localhost:8080',
secure: false,
bypass: function(request, response, proxyOptions)
{
return '/index_dev.html';
}
}
}
}
])
}
);