chore(): fix and run linter, bump node version to LTS
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const BundleAnalyzerPlugin =
|
||||
require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
|
||||
function generateConfig(name) {
|
||||
var config = {
|
||||
@@ -10,27 +10,29 @@ function generateConfig(name) {
|
||||
filename: name + '.js',
|
||||
sourceMapFilename: name + '.map',
|
||||
library: name,
|
||||
libraryTarget: 'umd'
|
||||
libraryTarget: 'umd',
|
||||
},
|
||||
devtool: "source-map",
|
||||
devtool: 'source-map',
|
||||
mode: 'production',
|
||||
|
||||
resolve: {
|
||||
// Add '.ts' and '.tsx' as resolvable extensions.
|
||||
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"],
|
||||
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'],
|
||||
alias: {
|
||||
[path.resolve(__dirname, "../lib/util/node-support.js")]:
|
||||
path.resolve(__dirname, "../lib/util/browser-support.js"),
|
||||
}
|
||||
[path.resolve(__dirname, '../lib/util/node-support.js')]: path.resolve(
|
||||
__dirname,
|
||||
'../lib/util/browser-support.js',
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
|
||||
{ test: /\.tsx?$/, loader: "ts-loader" },
|
||||
{ test: /\.tsx?$/, loader: 'ts-loader' },
|
||||
|
||||
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
|
||||
{ test: /\.js$/, loader: "source-map-loader" },
|
||||
{ test: /\.js$/, loader: 'source-map-loader' },
|
||||
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
@@ -38,28 +40,30 @@ function generateConfig(name) {
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [['@babel/preset-env', {
|
||||
'targets': {
|
||||
'node': 'current'
|
||||
}
|
||||
}]]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: {
|
||||
node: 'current',
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
config.plugins = [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
|
||||
}),
|
||||
new BundleAnalyzerPlugin({
|
||||
defaultSizes: 'stat',
|
||||
analyzerMode: 'static',
|
||||
reportFilename: '../doc/bundleReport.html',
|
||||
openAnalyzer: false,
|
||||
})
|
||||
}),
|
||||
];
|
||||
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user