generated from scientific-software-hub/waltz-webpack-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.test.config.js
45 lines (44 loc) · 1.31 KB
/
webpack.test.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
var path = require("path");
var pack = require("./package.json");
var webpack = require("webpack");
var babelSettings = {
extends: path.join(__dirname, "/.babelrc")
};
module.exports = {
output: {
// use absolute paths in sourcemaps (important for debugging via IDE)
devtoolModuleFilenameTemplate: "[absolute-resource-path]",
devtoolFallbackModuleFilenameTemplate: "[absolute-resource-path]?[hash]"
},
target: "node", // webpack should compile node compatible code
mode: "development",
devtool: "inline-cheap-module-source-map",
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader?" + JSON.stringify(babelSettings)
},
{
test: /\.(svg|png|jpg|gif|less|css)$/,
loader: "null-loader"
}
]
},
resolve: {
extensions: [".js"],
modules: ["./src", "node_modules"],
alias:{
"jet-views":path.resolve(__dirname, "src/views"),
"jet-locales":path.resolve(__dirname, "src/locales")
}
},
plugins: [
new webpack.DefinePlugin({
VERSION: `"${pack.version}"`,
APPNAME: `"${pack.name}"`,
PRODUCTION: false,
BUILD_AS_MODULE: true
})
]
};