forked from fergiemcdowall/search-index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.babel.js
47 lines (42 loc) · 987 Bytes
/
webpack.config.babel.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
import path from 'path'
import { version } from './package.json'
import glob from 'glob'
export default () => ([
// this stanza creates the stand-alone version of search-index that
// can be included in the <script> tag
{
mode: 'production',
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'search-index.' + version + '.js',
libraryTarget: 'umd',
globalObject: 'this',
library: 'searchIndex'
},
module: {
rules: [
{
test: /\.(js)$/,
exclude: /(node_modules|bower_components)/,
use: 'babel-loader'
}
]
},
node: {
fs: 'empty'
},
},
// this stanza make all of the tests run in the browser
{
mode: 'production',
entry: glob.sync('./test/src/*-test.js'),
output: {
path: path.resolve(__dirname, './test/sandbox'),
filename: 'bundle.js'
},
node: {
fs: 'empty'
}
}
])