2017-08-07 00:23:54 +02:00
|
|
|
const path = require("path");
|
|
|
|
const webpack = require("webpack");
|
|
|
|
|
2017-08-24 15:50:14 +02:00
|
|
|
|
2017-08-07 00:23:54 +02:00
|
|
|
const defines = {
|
|
|
|
"DEFAULT_WS_URI": process.env.WEBSOCKET_URI || "ws://localhost:8412/"
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
devtool: "source-map",
|
|
|
|
entry: [
|
2017-08-25 03:46:55 +02:00
|
|
|
'react-hot-loader/patch',
|
2017-08-07 00:23:54 +02:00
|
|
|
"webpack-hot-middleware/client",
|
2017-08-24 15:50:14 +02:00
|
|
|
"font-awesome-sass-loader!./font-awesome.config.js",
|
2017-08-07 00:23:54 +02:00
|
|
|
"./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-24 15:50:14 +02:00
|
|
|
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: [
|
|
|
|
{
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: { limit: 10000, mimetype: 'application/font-woff' },
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
|
|
|
use: [ { 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(),
|
2017-08-25 03:46:55 +02:00
|
|
|
new webpack.EnvironmentPlugin(defines),
|
|
|
|
new webpack.NamedModulesPlugin(),
|
2017-08-25 01:11:40 +02:00
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"react": "preact-compat",
|
2017-08-25 03:46:55 +02:00
|
|
|
"react-dom": "preact-compat",
|
|
|
|
"preact-compat": "preact-compat/dist/preact-compat"
|
2017-08-25 01:11:40 +02:00
|
|
|
}
|
|
|
|
}
|
2017-08-07 00:23:54 +02:00
|
|
|
};
|