From 2a0ee677d3f07a7dc158affa4111b9a4da4990e9 Mon Sep 17 00:00:00 2001 From: Jae Sung Park Date: Wed, 11 Apr 2018 13:00:02 +0900 Subject: [PATCH] chore(dev-env): Remove css inclusion on packaged build (#374) Remove the scss import to not be parsed Fix #372 Close #374 --- config/webpack.config.packaged.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/config/webpack.config.packaged.js b/config/webpack.config.packaged.js index faf57a0a4..f6ab820c3 100644 --- a/config/webpack.config.packaged.js +++ b/config/webpack.config.packaged.js @@ -1,5 +1,6 @@ const merge = require("webpack-merge"); const webpack = require("webpack"); +const StringReplacePlugin = require("string-replace-webpack-plugin"); const UglifyJSPlugin = require("uglifyjs-webpack-plugin"); const uglifyConfig = require("./uglify"); const banner = require("./banner"); @@ -13,11 +14,13 @@ const config = { module: { rules: [ { - test: /\.scss$/, - use: [ - {loader: "css-loader"}, - {loader: "sass-loader"} - ], + test: /(core\.js)$/, + loader: StringReplacePlugin.replace({ + replacements: [{ + pattern: /import \"\.\/scss\/main.scss\";/ig, + replacement: () => "" + }] + }) } ], },