chore: update webpack config

pull/2682/head 2.0.0-beta.2
tangjinzhou 4 years ago
parent be7de76abd
commit 2891168a0f

@ -3,14 +3,20 @@
module.exports = function(modules) { module.exports = function(modules) {
const plugins = [ const plugins = [
require.resolve('@ant-design-vue/babel-plugin-jsx'), require.resolve('@ant-design-vue/babel-plugin-jsx'),
require.resolve('babel-plugin-inline-import-data-uri'), require.resolve('@babel/plugin-proposal-optional-chaining'),
require.resolve('@babel/plugin-transform-member-expression-literals'),
require.resolve('@babel/plugin-transform-property-literals'),
require.resolve('@babel/plugin-proposal-export-default-from'),
require.resolve('@babel/plugin-transform-object-assign'), require.resolve('@babel/plugin-transform-object-assign'),
require.resolve('@babel/plugin-transform-template-literals'),
require.resolve('@babel/plugin-proposal-object-rest-spread'), require.resolve('@babel/plugin-proposal-object-rest-spread'),
require.resolve('@babel/plugin-proposal-export-default-from'),
require.resolve('@babel/plugin-proposal-class-properties'), require.resolve('@babel/plugin-proposal-class-properties'),
require.resolve('@babel/plugin-syntax-dynamic-import'),
// require.resolve('babel-plugin-inline-import-data-uri'),
// require.resolve('@babel/plugin-transform-member-expression-literals'),
// require.resolve('@babel/plugin-transform-property-literals'),
// require.resolve('@babel/plugin-proposal-export-default-from'),
// require.resolve('@babel/plugin-transform-object-assign'),
// require.resolve('@babel/plugin-transform-template-literals'),
// require.resolve('@babel/plugin-proposal-object-rest-spread'),
// require.resolve('@babel/plugin-proposal-class-properties'),
]; ];
plugins.push([ plugins.push([
require.resolve('@babel/plugin-transform-runtime'), require.resolve('@babel/plugin-transform-runtime'),
@ -29,7 +35,7 @@ module.exports = function(modules) {
'last 2 versions', 'last 2 versions',
'Firefox ESR', 'Firefox ESR',
'> 1%', '> 1%',
'ie >= 9', 'ie >= 11',
'iOS >= 8', 'iOS >= 8',
'Android >= 4', 'Android >= 4',
], ],

@ -8,6 +8,7 @@ const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const postcssConfig = require('./postcssConfig'); const postcssConfig = require('./postcssConfig');
const CleanUpStatsPlugin = require('./utils/CleanUpStatsPlugin'); const CleanUpStatsPlugin = require('./utils/CleanUpStatsPlugin');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const distFileBaseName = 'antd'; const distFileBaseName = 'antd';
@ -25,13 +26,11 @@ function getWebpackConfig(modules) {
const pkg = require(path.join(process.cwd(), 'package.json')); const pkg = require(path.join(process.cwd(), 'package.json'));
const babelConfig = require('./getBabelCommonConfig')(modules || false); const babelConfig = require('./getBabelCommonConfig')(modules || false);
const pluginImportOptions = [ const pluginImportOptions = {
{ style: true,
style: true, libraryName: distFileBaseName,
libraryName: distFileBaseName, libraryDirectory: 'components',
libraryDirectory: 'components', };
},
];
babelConfig.plugins.push([require.resolve('babel-plugin-import'), pluginImportOptions]); babelConfig.plugins.push([require.resolve('babel-plugin-import'), pluginImportOptions]);
if (modules === false) { if (modules === false) {
@ -157,6 +156,7 @@ function getWebpackConfig(modules) {
}, },
plugins: [ plugins: [
// new BundleAnalyzerPlugin(),
new CaseSensitivePathsPlugin(), new CaseSensitivePathsPlugin(),
new webpack.BannerPlugin(` new webpack.BannerPlugin(`
${pkg.name} v${pkg.version} ${pkg.name} v${pkg.version}

@ -1,6 +1,6 @@
{ {
"name": "ant-design-vue", "name": "ant-design-vue",
"version": "1.6.4", "version": "2.0.0-beta.2",
"title": "Ant Design Vue", "title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation", "description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [ "keywords": [
@ -176,6 +176,7 @@
"vue-virtual-scroller": "^1.0.0", "vue-virtual-scroller": "^1.0.0",
"vuex": "^4.0.0-beta.2", "vuex": "^4.0.0-beta.2",
"webpack": "^4.28.4", "webpack": "^4.28.4",
"webpack-bundle-analyzer": "^3.8.0",
"webpack-cli": "^3.2.1", "webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14", "webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.1.1", "webpack-merge": "^4.1.1",

@ -1,7 +1,6 @@
// This config is for building dist files // This config is for building dist files
const webpack = require('webpack');
const getWebpackConfig = require('./antd-tools/getWebpackConfig'); const getWebpackConfig = require('./antd-tools/getWebpackConfig');
const { webpack } = getWebpackConfig;
// noParse still leave `require('./locale' + name)` in dist files // noParse still leave `require('./locale' + name)` in dist files
// ignore is better // ignore is better
// http://stackoverflow.com/q/25384360 // http://stackoverflow.com/q/25384360

Loading…
Cancel
Save