fixed webpack config for local build

pull/25/head
Szymon Lesisz 6 years ago
parent 9c651669c8
commit c7cd4c9525

@ -2,6 +2,7 @@ import webpack from 'webpack';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import HtmlWebpackPlugin from 'html-webpack-plugin'; import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin'; import CopyWebpackPlugin from 'copy-webpack-plugin';
import MiniCssExtractPlugin from '../../trezor-connect/node_modules/mini-css-extract-plugin';
import { import {
TREZOR_CONNECT_ROOT, TREZOR_CONNECT_ROOT,
@ -47,20 +48,17 @@ module.exports = {
{ {
test: /\.js?$/, test: /\.js?$/,
exclude: /node_modules/, exclude: /node_modules/,
use: ['babel-loader'],
},
{
test: /\.less$/,
use: [ use: [
'babel-loader',
{ {
loader: 'eslint-loader', loader: MiniCssExtractPlugin.loader,
options: { options: { publicPath: '../' },
emitWarning: true,
},
},
{
loader: 'stylelint-custom-processor-loader',
options: {
configPath: '.stylelintrc',
},
}, },
`${TREZOR_CONNECT_ROOT}/node_modules/css-loader`,
`${TREZOR_CONNECT_ROOT}/node_modules/less-loader`,
], ],
}, },
{ {
@ -113,6 +111,11 @@ module.exports = {
hints: false, hints: false,
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
}),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
chunks: ['index'], chunks: ['index'],
template: `${SRC}index.html`, template: `${SRC}index.html`,

Loading…
Cancel
Save