mon-entreprise/source/webpack.common.js

90 lines
1.7 KiB
JavaScript
Raw Normal View History

/* eslint-env node */
2018-07-05 09:54:41 +00:00
const HTMLPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
const path = require('path')
2016-06-29 10:27:04 +00:00
module.exports = {
resolve: {
alias: {
Engine: path.resolve('source/engine/'),
Règles: path.resolve('source/règles/'),
2017-12-11 14:42:03 +00:00
Components: path.resolve('source/components/'),
2018-06-06 16:17:13 +00:00
Images: path.resolve('source/images/'),
Selectors: path.resolve('source/selectors/'),
InFrance: path.resolve('source/components/inFranceApp/')
}
},
output: {
path: path.resolve('./dist/'),
filename: '[name].[hash].js'
},
2016-06-29 10:27:04 +00:00
module: {
2018-03-01 19:30:57 +00:00
rules: [
{
test: /\.css$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader',
options: {
sourceMap: true,
importLoaders: 1
}
},
{
loader: 'postcss-loader'
2017-03-14 14:00:54 +00:00
}
]
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.(jpe?g|png|svg)$/,
use: {
loader: 'file-loader',
options: {
name: 'images/[name].[ext]'
}
}
},
{
test: /\.yaml$/,
loader: 'json-loader!yaml-loader'
},
{
test: /\.js$/,
exclude: /node_modules|dist/,
loader: 'babel-loader'
},
{
test: /\.csv$/,
loader: 'csv-loader',
options: {
dynamicTyping: true,
header: true,
skipEmptyLines: true
2017-03-14 14:00:54 +00:00
}
},
{
test: /\.ne$/,
loader: 'babel-loader!nearley-loader'
}
]
},
plugins: [
2018-07-05 09:54:41 +00:00
new HTMLPlugin({
template: 'index.html',
chunks: ['bundle']
}),
new HTMLPlugin({
template: 'couleur.html',
chunks: ['colour-chooser'],
filename: 'couleur.html'
}),
2018-07-05 16:01:01 +00:00
new CopyPlugin(['./manifest.webmanifest', './source/images/logo'])
]
2016-06-29 10:27:04 +00:00
}