mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
23 lines
680 B
JavaScript
23 lines
680 B
JavaScript
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
const fse = require('fs-extra');
|
|
// read from lerna
|
|
const lernaConfig = JSON.parse(fse.readFileSync('../../lerna.json', 'utf8'));
|
|
const { version } = lernaConfig;
|
|
|
|
module.exports = ({ context, onGetWebpackConfig }) => {
|
|
onGetWebpackConfig((config) => {
|
|
config.resolve
|
|
.plugin('tsconfigpaths')
|
|
.use(TsconfigPathsPlugin, [{
|
|
configFile: './tsconfig.json',
|
|
}]);
|
|
config
|
|
.plugin('define')
|
|
.use(context.webpack.DefinePlugin, [{
|
|
VERSION_PLACEHOLDER: JSON.stringify(version),
|
|
}]);
|
|
config.plugins.delete('hot');
|
|
config.devServer.hot(false);
|
|
});
|
|
};
|