-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.development.config.js
55 lines (54 loc) · 1.37 KB
/
webpack.development.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
/* eslint-env node */
const path = require('path');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
mode: 'development',
target: 'web',
entry: './src/jepub.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'jepub.js',
library: 'jEpub',
libraryTarget: 'umd',
umdNamedDefine: true
},
resolve: {
extensions: ['.js', '.ejs'],
fallback: {
fs: false
}
},
devtool: 'source-map',
module: {
rules: [
{
test: /[^.]|\.(xml|html|css|ejs)$/,
include: [
path.resolve(__dirname, 'src/tpl')
],
use: 'raw-loader'
},
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src')
],
exclude: [
path.resolve(__dirname, 'src/tpl')
],
use: 'babel-loader'
}
]
},
plugins: [
new BrowserSyncPlugin({
host: 'localhost',
port: 3333,
server: {
baseDir: ['demo', 'dist', 'node_modules/jszip/dist', 'node_modules/ejs']
},
files: ['demo', 'dist'],
index: '_index.html'
})
]
};