forked from MapGIS/WebClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenlayers-debug-config.js
More file actions
44 lines (43 loc) · 1.39 KB
/
openlayers-debug-config.js
File metadata and controls
44 lines (43 loc) · 1.39 KB
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
var webpack = require('webpack');
var path = require('path');
var HappyPack = require('happypack');//多线程loader 加快编译速度
var os = require('os');
var happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length });
module.exports = {
mode:'development',
devtool: 'eval-source-map',
entry: path.join(__dirname, '.', 'openlayers_main.js'),//已多次提及的唯一入口文件
output: {
path: path.join(__dirname, '.', 'output'),//打包后的文件存放的地方
// filename: "MapGis_ol_debug.js"//打包后输出文件的文件名
filename: "webclient-openlayers-framework.js"//打包后输出文件的文件名
},
externals: {
// 'openlayers': 'ol',
},
module: {
//noParse: /[\/\\]node_modules\.js$/,
rules: [
{
test: /(\.js)$/,
use: 'happypack/loader?id=js',
exclude: [/node_modules/,/mapboxgl/,/leaflet/]
}
]
},
plugins: [
new HappyPack({
id: 'js',
// threads: 4,
threadPool: happyThreadPool,
loaders: [{
loader: 'babel-loader',
options: {
presets: ['es2015'],
cacheDirectory: true,
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties']
}
}]
})
]
}