merged old webpack.config from admin and removed test targets, fuck tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const ROOT_PATH = path.resolve(__dirname);
|
||||
@@ -8,7 +9,8 @@ const NODE_MODULES_PATH = path.resolve(ROOT_PATH, 'node_modules');
|
||||
const ENTRY_FILE = path.resolve(APP_PATH, 'index');
|
||||
const TEMPLATE_FILE = path.resolve(APP_PATH, 'index.html'); //html
|
||||
|
||||
module.exports = {
|
||||
module.exports = [
|
||||
{
|
||||
mode: 'development',
|
||||
devtool: 'source-map',
|
||||
entry: {
|
||||
@@ -24,74 +26,6 @@ module.exports = {
|
||||
chunkFilename: '[name].[chunkhash:8].js',
|
||||
publicPath: '/'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.html$/,
|
||||
use: {
|
||||
loader: 'html-loader',
|
||||
options: {
|
||||
exportAsEs6Default: true,
|
||||
minimize: true,
|
||||
removeComments: true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
exclude: NODE_MODULES_PATH,
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader'],
|
||||
include: APP_PATH
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
exclude: NODE_MODULES_PATH,
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
|
||||
include: APP_PATH
|
||||
},
|
||||
{
|
||||
test: /\.(eot|woff|ttf|woff2)(\?|$)/,
|
||||
exclude: NODE_MODULES_PATH,
|
||||
use: {
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]'
|
||||
}
|
||||
},
|
||||
include: APP_PATH
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
exclude: NODE_MODULES_PATH,
|
||||
use: {
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 8192,
|
||||
name: 'images/[name].[hash:8].[ext]'
|
||||
}
|
||||
},
|
||||
include: APP_PATH
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
exclude: NODE_MODULES_PATH,
|
||||
use: [
|
||||
'ts-loader',
|
||||
{
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
configFile: ROOT_PATH + '/tslint.json'
|
||||
}
|
||||
}
|
||||
],
|
||||
include: APP_PATH
|
||||
}
|
||||
]
|
||||
},
|
||||
devServer: {
|
||||
hot: true,
|
||||
contentBase: BUILD_PATH,
|
||||
@@ -134,4 +68,47 @@ module.exports = {
|
||||
'@': APP_PATH,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
mode: 'development',
|
||||
entry: path.resolve(__dirname, 'lib/FrontblockLib.js'),
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'static'),
|
||||
filename: 'FrontblockLib.js',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\FrontblockLib.ts/, use: 'ts-loader' }
|
||||
]
|
||||
},
|
||||
optimization: {
|
||||
minimizer: [new TerserPlugin({
|
||||
cache: true,
|
||||
parallel: true,
|
||||
terserOptions:{
|
||||
mangle: false,
|
||||
keep_classnames: true
|
||||
}
|
||||
})],
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
common: {
|
||||
chunks: 'all',
|
||||
minChunks: 2,
|
||||
maxInitialRequests: 5,
|
||||
minSize: 0,
|
||||
name: 'common'
|
||||
},
|
||||
vendor: {
|
||||
test: /node_modules/,
|
||||
chunks: 'all',
|
||||
name: 'vendor',
|
||||
priority: 10,
|
||||
enforce: true,
|
||||
minChunks: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user