You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
const path = require('path');
|
|
|
|
export default {
|
|
entry: 'src/index.js',
|
|
extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]],
|
|
env: {
|
|
development: {
|
|
extraBabelPlugins: ['dva-hmr'],
|
|
},
|
|
},
|
|
externals: {
|
|
'@antv/data-set': 'DataSet',
|
|
bizcharts: 'BizCharts',
|
|
rollbar: 'rollbar',
|
|
},
|
|
alias: {
|
|
components: path.resolve(__dirname, 'src/components/'),
|
|
},
|
|
externals: {
|
|
'@antv/data-set': 'DataSet',
|
|
bizcharts: 'BizCharts',
|
|
rollbar: 'rollbar',
|
|
},
|
|
ignoreMomentLocale: true,
|
|
theme: './src/theme.js',
|
|
html: {
|
|
template: './src/index.ejs',
|
|
},
|
|
publicPath: '/',
|
|
disableDynamicImport: true,
|
|
hash: true,
|
|
lessLoaderOptions: {
|
|
javascriptEnabled: true,
|
|
},
|
|
cssLoaderOptions: {
|
|
modules: true,
|
|
getLocalIdent: (context, localIdentName, localName) => {
|
|
if (context.resourcePath.includes('node_modules')) {
|
|
return localName;
|
|
}
|
|
|
|
let antdProPath = context.resourcePath.match(/src(.*)/)[1].replace('.less', '');
|
|
if (context.resourcePath.includes('components')) {
|
|
antdProPath = antdProPath.replace('components/', '');
|
|
}
|
|
const arr = antdProPath
|
|
.split('/')
|
|
.map(a => a.replace(/([A-Z])/g, '-$1'))
|
|
.map(a => a.toLowerCase());
|
|
return `antd-pro${arr.join('-')}-${localName}`.replace('--', '-');
|
|
},
|
|
},
|
|
};
|
|
|