-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.plugin.js
More file actions
23 lines (21 loc) · 775 Bytes
/
build.plugin.js
File metadata and controls
23 lines (21 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { includes } = require('lodash');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// const BundleBuddyWebpackPlugin = require("bundle-buddy-webpack-plugin");
const webpack = require('webpack');
const Config = require('webpack-chain');
const packageInfo = require('./package.json');
module.exports = ({ context, onGetWebpackConfig }) => {
onGetWebpackConfig((config) => {
config.plugin('DefinePlugin').use(
new webpack.DefinePlugin({
VERSION: JSON.stringify(packageInfo.version),
}),
);
config.resolve.plugin('tsconfigpaths').use(TsconfigPathsPlugin, [
{
configFile: './tsconfig.json',
},
]);
});
};