Use single build file (#635)
This commit is contained in:
parent
68281e0985
commit
2ffb88c979
|
@ -13,6 +13,7 @@
|
|||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<script src="/config.js"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=String.prototype.startsWith,Array.from,Array.prototype.fill,Array.prototype.keys,Array.prototype.find,Array.prototype.findIndex,Array.prototype.includes,String.prototype.repeat,Number.isInteger,Promise&flags=gated"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
<?php if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)): ?>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=String.prototype.startsWith,Array.from,Array.prototype.fill,Array.prototype.keys,Array.prototype.find,Array.prototype.findIndex,Array.prototype.includes,String.prototype.repeat,Number.isInteger,Promise&flags=gated"></script>
|
||||
<?php endif; ?>
|
||||
<script src="<?=$url ?>/vendor.js"></script>
|
||||
<script src="<?=$url ?>/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -10,15 +10,11 @@ const {dependencies} = require('./package.json');
|
|||
const BUILD_DIR = path.join(__dirname, 'build');
|
||||
const APP_DIR = path.join(__dirname, 'src');
|
||||
|
||||
const VENDOR_LIST = Object.keys(dependencies);
|
||||
|
||||
const config = env => {
|
||||
return {
|
||||
devtool: 'source-map',
|
||||
entry: {
|
||||
config: APP_DIR + '/config.js',
|
||||
bundle: APP_DIR + '/index.js',
|
||||
vendor: VENDOR_LIST,
|
||||
},
|
||||
output: {
|
||||
path: BUILD_DIR,
|
||||
|
@ -93,30 +89,13 @@ const config = env => {
|
|||
// }),
|
||||
new CopyPlugin([
|
||||
'./src/.htaccess',
|
||||
'./src/config.js',
|
||||
{from: './src/assets/images', to: 'images'},
|
||||
]),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: process.env.NODE_ENV !== 'production' ? 'server' : 'disabled'
|
||||
}),
|
||||
],
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
config: {
|
||||
chunks: 'initial',
|
||||
name: 'config',
|
||||
test: 'config',
|
||||
enforce: true,
|
||||
},
|
||||
vendor: {
|
||||
chunks: 'initial',
|
||||
name: 'vendor',
|
||||
test: 'vendor',
|
||||
enforce: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
modules: ['./src', './node_modules']
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue