Skip to content
Permalink
Browse files

omitting babel loader when using .f12, cutting compile time in half

Change-Id: I93d0d3b98cc0473feed11ec3ebd67872893558ca
  • Loading branch information...
Andreas Boesl
Andreas Boesl committed Aug 8, 2019
1 parent 39007f4 commit 3e0dfae8b4358def1857811bf2f88c8ba12e80fc
Showing with 19 additions and 10 deletions.
  1. +2 −0 web/.f12
  2. +17 −10 webpack.config.js
@@ -5,6 +5,8 @@
SITE=${SITE:-$(omd sites --bare | head -n 1)}
ROOT=/omd/sites/$SITE

export NO_BABEL_LOADER=1

echo "Updating compiled JS/CSS files..."
make -C .. \
web/htdocs/js/main_min.js \
@@ -35,16 +35,6 @@ module.exports = {
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
}
}
},
// needed for theme CSS files
{
test: /\.scss$/,
@@ -97,3 +87,20 @@ module.exports = {
new webpack.EnvironmentPlugin(["ENTERPRISE", "MANAGED"]),
]
};


if (process.env.NO_BABEL_LOADER == undefined) {
let babel_loader = {
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
}
}
}
module.exports.module.rules.unshift(babel_loader)
}


0 comments on commit 3e0dfae

Please sign in to comment.
You can’t perform that action at this time.