mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
IMPR: Add ts-loader
This commit is contained in:
parent
92e8cfa5b5
commit
ff5f84f500
@ -172,6 +172,8 @@
|
||||
"terser-webpack-plugin": "^5.2.3",
|
||||
"ts-invariant": "^0.9.1",
|
||||
"tslib": "^2.3.1",
|
||||
"ts-loader": "^9.2.5",
|
||||
"typescript": "^4.4.3",
|
||||
"url": "^0.11.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.52.0",
|
||||
|
@ -6,10 +6,9 @@ const conf = common.configuration;
|
||||
|
||||
const webpack = require('webpack');
|
||||
const {
|
||||
merge
|
||||
merge,
|
||||
} = require('webpack-merge');
|
||||
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
@ -130,7 +129,7 @@ common.themes.forEach((theme) => {
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
||||
.BundleAnalyzerPlugin;
|
||||
@ -204,7 +203,7 @@ const cfg = merge(common.webpack, {
|
||||
'default',
|
||||
{
|
||||
discardComments: {
|
||||
removeAll: true
|
||||
removeAll: true,
|
||||
},
|
||||
zindex: true,
|
||||
cssDeclarationSorter: true,
|
||||
@ -217,11 +216,11 @@ const cfg = merge(common.webpack, {
|
||||
discardDuplicates: true,
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
},],
|
||||
minify: [
|
||||
CssMinimizerPlugin.cssnanoMinify,
|
||||
//CssMinimizerPlugin.cleanCssMinify,
|
||||
]
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
@ -233,7 +232,7 @@ const cfg = merge(common.webpack, {
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [{
|
||||
rules: [{ test: /\.tsx?$/, loader: 'ts-loader' }, {
|
||||
test: /\.jsx?$/,
|
||||
//exclude: /node_modules/,
|
||||
use: {
|
||||
@ -250,7 +249,7 @@ const cfg = merge(common.webpack, {
|
||||
},
|
||||
], //Preset used for env setup
|
||||
plugins: [
|
||||
['@babel/transform-react-jsx']
|
||||
['@babel/transform-react-jsx'],
|
||||
],
|
||||
cacheDirectory: true,
|
||||
cacheCompression: true,
|
||||
@ -276,19 +275,19 @@ const cfg = merge(common.webpack, {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
}, ],
|
||||
},],
|
||||
},
|
||||
{
|
||||
test: /fontawesome([^.]+).(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
||||
type: "asset/resource",
|
||||
type: 'asset/resource',
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|otf|eot|woff(2)?)$/,
|
||||
type: "asset/resource",
|
||||
type: 'asset/resource',
|
||||
},
|
||||
{
|
||||
test: /\.(png|webp|jpg|jpeg|gif|svg)$/,
|
||||
type: "javascript/auto",
|
||||
type: 'javascript/auto',
|
||||
use: [{
|
||||
loader: 'img-optimize-loader',
|
||||
options: {
|
||||
@ -324,12 +323,12 @@ const cfg = merge(common.webpack, {
|
||||
limit: 1,
|
||||
},
|
||||
},
|
||||
}, ],
|
||||
}, ],
|
||||
},],
|
||||
},],
|
||||
},
|
||||
|
||||
plugins: plugins,
|
||||
});
|
||||
});
|
||||
|
||||
console.log(cfg);
|
||||
module.exports = cfg;
|
||||
|
@ -10,7 +10,7 @@ const fs = require('fs');
|
||||
//const autoprefixer = require('autoprefixer');
|
||||
const webpack = require('webpack');
|
||||
const {
|
||||
merge
|
||||
merge,
|
||||
} = require('webpack-merge');
|
||||
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
@ -54,7 +54,7 @@ const config = merge(common.webpack, {
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [{
|
||||
rules: [{ test: /\.tsx?$/, loader: 'ts-loader' }, {
|
||||
test: /\.jsx?$/,
|
||||
//exclude: /node_modules/,
|
||||
use: {
|
||||
@ -99,19 +99,19 @@ const config = merge(common.webpack, {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
}, ],
|
||||
},],
|
||||
},
|
||||
{
|
||||
test: /fontawesome([^.]+).(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
||||
type: "asset/resource",
|
||||
type: 'asset/resource',
|
||||
},
|
||||
{
|
||||
test: /\.(gif|png|jpg|jpeg|ttf|otf|eot|svg|webp|woff(2)?)$/,
|
||||
type: "asset/resource",
|
||||
type: 'asset/resource',
|
||||
}, {
|
||||
test: /\.(png|webp|jpg|jpeg|gif|svg)$/,
|
||||
type: "asset/resource",
|
||||
}, ],
|
||||
type: 'asset/resource',
|
||||
},],
|
||||
},
|
||||
plugins: plugins,
|
||||
|
||||
@ -132,6 +132,6 @@ const config = merge(common.webpack, {
|
||||
'service-worker-allowed': '/',
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = config;
|
||||
|
Loading…
Reference in New Issue
Block a user