forked from miccomservices/CoinSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
61 lines (60 loc) · 1.5 KB
/
webpack.common.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
module.exports = {
entry: {
loader: './app/loader/index.js',
},
output: {
filename: 'assets/js/[name].[hash:8].js',
chunkFilename: 'assets/js/[name].[hash:8].js',
path: path.resolve(__dirname, 'build'),
},
resolve: {
alias: {
lib: path.resolve(__dirname, 'app/lib'),
pages: path.resolve(__dirname, 'app/pages'),
widgets: path.resolve(__dirname, 'app/widgets'),
modernizr$: path.resolve(__dirname, '.modernizrrc')
}
},
module: {
rules: [
{
test: /\.(png|svg|jpg|gif|ico|woff|woff2|eot|ttf|otf)$/,
loader: 'file-loader',
options: {
name: '[path][name].[hash:8].[ext]',
context: './app/'
}
},
{
test:/\.ract$/,
use: ['ractive-loader']
},
{
test: /\.modernizrrc$/,
use: ['modernizr-loader', 'json-loader']
}
],
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['loader'],
template: 'app/index.ejs'
}),
new HtmlWebpackPlugin({
inject: false,
template: 'app/apple-app-site-association.ejs',
filename: 'apple-app-site-association'
}),
new HtmlWebpackPlugin({
inject: false,
template: 'app/apple-app-site-association.ejs',
filename: '.well-known/apple-app-site-association'
}),
new webpack.ProvidePlugin({
'Promise': 'es6-promise'
})
]
};