-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathwebpack.debug.js
37 lines (32 loc) · 963 Bytes
/
webpack.debug.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
const path = require('path');
const config = require('./webpack.common');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
config.entry = './src/debug.js';
config.output = {
path: path.join(__dirname, "debug"),
filename: 'paella.js',
sourceMapFilename: 'paella.js.map'
}
config.devtool = "source-map";
config.devServer = {
port: 8000,
allowedHosts: 'all',
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
}
};
config.plugins.push(new HtmlWebpackPlugin({
template: "src/index.html",
inject: false
}));
config.plugins.push(new CopyWebpackPlugin({
patterns: [
{ from: 'config', to: 'config' },
{ from: 'repository_test/repository', to: 'repository' },
{ from: 'src/skins', to: 'skins' }
]
}));
module.exports = config;