forked from OpenGeoscience/geojs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-tutorials.config.js
64 lines (58 loc) · 1.49 KB
/
webpack-tutorials.config.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
62
63
64
const StringReplacePlugin = require('string-replace-webpack-plugin');
var path = require('path');
var base = require('./webpack.config');
var rules = base.module.rules.concat([{
test: /\.pug$/,
use: ['pug-loader']
}, {
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
use: ['url-loader?limit=10000&mimetype=application/font-woff']
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: ['url-loader?limit=10000&mimetype=application/octet-stream']
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
use: ['file-loader']
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: ['url-loader?limit=10000&mimetype=image/svg+xml']
}, {
test: require.resolve('codemirror'),
use: ['expose-loader?CodeMirror']
}, {
test: /bootstrap.css$/,
use: StringReplacePlugin.replace({
replacements: [{
pattern: /@import.*fonts.googleapis.com\/css\?family=Lato[^;]*;/g,
replacement: () => '@import url(../../typeface-lato/index.css);'
}]
})
}]);
var plugins = base.plugins;
plugins.push(new StringReplacePlugin());
var resolve = {
extensions: ['.js', '.css', '.pug'],
alias: base.resolve.alias
};
module.exports = {
/* webpack 4
mode: 'production',
*/
performance: {hints: false},
cache: true,
devtool: 'source-map',
context: path.join(__dirname),
entry: {
bundle: './tutorials/index.js'
},
output: {
path: path.join(__dirname, 'dist', 'tutorials'),
publicPath: '/tutorials/',
filename: '[name].js'
},
module: {
rules: rules
},
resolve: resolve,
plugins: plugins
};