receptor/webpack.config.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-08-07 00:23:54 +02:00
const path = require("path");
const webpack = require("webpack");
const defines = {
"DEFAULT_WS_URI": process.env.WEBSOCKET_URI || "ws://localhost:8412/"
};
module.exports = {
devtool: "source-map",
entry: [
"webpack-hot-middleware/client",
"./src/index.js"
],
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
publicPath: "/dist/"
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
2017-08-07 00:40:16 +02:00
{ test: /\.(ttf|eot|svg|woff2?)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
2017-08-07 00:23:54 +02:00
{ test: /\.scss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
includePaths: [
2017-08-22 21:49:48 +02:00
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, './scss/srht/srht/scss'),
2017-08-07 00:23:54 +02:00
]
2017-08-22 21:49:48 +02:00
},
2017-08-07 00:23:54 +02:00
}
],
}
]
},
plugins:[
new webpack.HotModuleReplacementPlugin(),
new webpack.EnvironmentPlugin(defines)
]
};