2020-03-11 20:25:15 +08:00

45 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const path = require('path');
module.exports = {
entry: {
'index': 'src/index.tsx',
'simulator-renderer': '../designer/src/builtins/simulator/renderer/index.ts'
},
"vendor": false,
publicPath: './',
alias: {
'@': path.resolve(__dirname, './src'),
},
plugins: [
['ice-plugin-fusion', {
themePackage: '@alife/theme-lowcode-light',
}],
['ice-plugin-moment-locales', {
locales: ['zh-cn'],
}],
],
externals: {
'react': 'var window.React',
'react-dom': 'var window.ReactDOM',
'prop-types': 'var window.PropTypes',
// '@recore/obx': 'var window.Recore',
// '@recore/obx-react': 'var window.Recore',
'@ali/lowcode-renderer': 'var window.LowCodeRenderer',
'@alifd/next': 'var window.Next',
'moment': 'var window.moment',
},
chainWebpack: (config) => {
// 修改对应 css module的 loader默认修改 scss-module 同理可以修改 css-module 和 less-module 规则
['scss-module'].forEach((rule) => {
if (config.module.rules.get(rule)) {
config.module.rule(rule).use('ts-css-module-loader')
.loader(require.resolve('css-modules-typescript-loader'))
.options({ modules: true, sass: true });
// 指定应用loader的位置
config.module.rule(rule).use('ts-css-module-loader').before('css-loader');
}
});
},
};