-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
69 lines (65 loc) · 2.3 KB
/
webpack.config.js
File metadata and controls
69 lines (65 loc) · 2.3 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* global __dirname */
var path = require('path');
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var dir_js = path.resolve(__dirname, 'js');
var dir_html = path.resolve(__dirname, 'html');
var dir_build = path.resolve(__dirname, 'build');
module.exports = {
entry: {
autocomplete2: [path.resolve(dir_js, 'autocomplete2.js')],
mergehotgrid1: [path.resolve(dir_js, 'mergehotgrid1.js')],
mergehotgrid2: [path.resolve(dir_js, 'mergehotgrid2.js')],
bundle: [path.resolve(dir_js, 'main.js')]
},
output: {
path: dir_build,
filename: '[name].js'
},
// watchOptions: {
// poll: true
// },
devServer: {
contentBase: dir_build,
},
module: {
loaders: [{
loader: 'babel-loader',
test: dir_js,
},{
test: /\.css$/,
include: /node_modules/,
loaders: ['style-loader', 'css-loader'],
}],
noParse: [
path.join(__dirname, "node_modules/handsontable/dist/handsontable.full.js"),
path.join(__dirname, "node_modules/tree-model/dist/TreeModel-min.js"),
]
},
resolve: {
alias: {
'handsontable': path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.js'),
'handsontable.css': path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.css'),
'handlebars': path.join(__dirname, '/node_modules/handlebars/dist/handlebars'),
'TreeModel': path.join(__dirname, '/node_modules/tree-model/dist/TreeModel-min.js'),
'moment': path.join(__dirname, '/node_modules/moment/moment.js'),
'hot-formula-parser': path.join(__dirname, '/node_modules/hot-formula-parser/dist/formula-parser.js')
}
},
plugins: [
// Simply copies the files over
new CopyWebpackPlugin([
{ from: dir_html } // to: output.path
]),
// Avoid publishing files when compilation fails
new webpack.NoErrorsPlugin(),
// 한글언어팩만 추가
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /ko/)
],
stats: {
// Nice colored output
colors: true
},
// Create Sourcemaps for the bundle
devtool: 'source-map',
};