forked from cj/opal-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (41 loc) · 1.1 KB
/
webpack.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
const path = require("path");
const LiveReloadPlugin = require('webpack-livereload-plugin');
const stubs = process.env.CONNECT_STUBS.split(',');
const WatchIgnorePlugin = require("webpack").WatchIgnorePlugin;
module.exports = {
resolve: {
extensions: ['', '.js', '.css', '.rb'],
alias: {
app: path.resolve(__dirname, "app"),
spec: path.resolve(__dirname, "spec")
}
},
entry: {
connect: ['./.connect/opal.js', './.connect/connect.js'],
app: './.connect/entry.rb',
rspec: './.connect/rspec.js'
},
output: {
path: path.resolve(__dirname, ".connect", "output"),
filename: '[name].js'
},
module: {
test: /\.rb$/,
loaders: [
{
exclude: /node_modules|\.connect\/(opal|cache|connect|rspec|output)/,
loader: "opal-webpack",
query: { dynamic_require_severity: 'ignore' }
}
]
},
// watchOptions: { poll: true, lazy: true },
plugins: [
new LiveReloadPlugin({ ignore: /entry\.rb/ }),
],
opal: {
stubs: stubs,
cacheDirectory: '.connect/cache'
},
devtool: 'inline-source-map'
}