From c7cd4c9525764c00ebfb0ed6aa26f9d2a463bbb1 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Thu, 13 Sep 2018 09:27:09 +0200 Subject: [PATCH] fixed webpack config for local build --- webpack/local.babel.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/webpack/local.babel.js b/webpack/local.babel.js index c62b2e08..92930de8 100644 --- a/webpack/local.babel.js +++ b/webpack/local.babel.js @@ -2,6 +2,7 @@ import webpack from 'webpack'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import CopyWebpackPlugin from 'copy-webpack-plugin'; +import MiniCssExtractPlugin from '../../trezor-connect/node_modules/mini-css-extract-plugin'; import { TREZOR_CONNECT_ROOT, @@ -47,20 +48,17 @@ module.exports = { { test: /\.js?$/, exclude: /node_modules/, + use: ['babel-loader'], + }, + { + test: /\.less$/, use: [ - 'babel-loader', { - loader: 'eslint-loader', - options: { - emitWarning: true, - }, - }, - { - loader: 'stylelint-custom-processor-loader', - options: { - configPath: '.stylelintrc', - }, + loader: MiniCssExtractPlugin.loader, + options: { publicPath: '../' }, }, + `${TREZOR_CONNECT_ROOT}/node_modules/css-loader`, + `${TREZOR_CONNECT_ROOT}/node_modules/less-loader`, ], }, { @@ -113,6 +111,11 @@ module.exports = { hints: false, }, plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].css', + chunkFilename: '[id].css', + }), + new HtmlWebpackPlugin({ chunks: ['index'], template: `${SRC}index.html`,