mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 04:48:25 +01:00
Build tools: Combine webpack config files.
This prepares us for building the Gutenberg packages. Merges [43687] to trunk. See #45065. git-svn-id: https://develop.svn.wordpress.org/trunk@43978 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b8fb0eaeca
commit
f173141c5b
@ -1,7 +1,6 @@
|
||||
/* jshint node:true */
|
||||
/* globals Set */
|
||||
var webpackConfig = require( './webpack.config.prod' );
|
||||
var webpackDevConfig = require( './webpack.config.dev' );
|
||||
var webpackConfig = require( './webpack.config' );
|
||||
|
||||
module.exports = function(grunt) {
|
||||
var path = require('path'),
|
||||
@ -704,8 +703,8 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
webpack: {
|
||||
prod: webpackConfig,
|
||||
dev: webpackDevConfig
|
||||
prod: webpackConfig( { environment: 'production' } ),
|
||||
dev: webpackConfig( { environment: 'development' } )
|
||||
},
|
||||
concat: {
|
||||
tinymce: {
|
||||
@ -1090,7 +1089,6 @@ module.exports = function(grunt) {
|
||||
config: {
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'webpack-dev.config.js',
|
||||
'webpack.config.js'
|
||||
]
|
||||
},
|
||||
|
@ -14,10 +14,11 @@ include_files = {
|
||||
'build/wp-includes/js/media-views.min.js': ['./src/js/_enqueues/wp/media/views.js'],
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
module.exports = function( env = { environment: "production" } ) {
|
||||
const mode = env.environment;
|
||||
|
||||
const mediaConfig = {
|
||||
cache: true,
|
||||
watch: false,
|
||||
entry: Object.assign( admin_files, include_files ),
|
||||
output: {
|
||||
filename: '[name]',
|
||||
@ -28,5 +29,11 @@ module.exports = [
|
||||
minimize: true
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
if ( mode === 'production' ) {
|
||||
mediaConfig.plugins.push( new webpack.optimize.ModuleConcatenationPlugin() );
|
||||
}
|
||||
];
|
||||
|
||||
return mediaConfig;
|
||||
};
|
@ -1,33 +0,0 @@
|
||||
var path = require( 'path' ),
|
||||
webpack = require( 'webpack' ),
|
||||
admin_files = {},
|
||||
include_files = {};
|
||||
|
||||
include_files = {
|
||||
'build/wp-includes/js/media-audiovideo.js': ['./src/js/_enqueues/wp/media/audiovideo.js'],
|
||||
'build/wp-includes/js/media-audiovideo.min.js': ['./src/js/_enqueues/wp/media/audiovideo.js'],
|
||||
'build/wp-includes/js/media-grid.js': ['./src/js/_enqueues/wp/media/grid.js'],
|
||||
'build/wp-includes/js/media-grid.min.js': ['./src/js/_enqueues/wp/media/grid.js'],
|
||||
'build/wp-includes/js/media-models.js': ['./src/js/_enqueues/wp/media/models.js'],
|
||||
'build/wp-includes/js/media-models.min.js': ['./src/js/_enqueues/wp/media/models.js'],
|
||||
'build/wp-includes/js/media-views.js': ['./src/js/_enqueues/wp/media/views.js'],
|
||||
'build/wp-includes/js/media-views.min.js': ['./src/js/_enqueues/wp/media/views.js'],
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
cache: true,
|
||||
watch: false,
|
||||
entry: Object.assign( admin_files, include_files ),
|
||||
output: {
|
||||
filename: '[name]',
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
include: /\.min\.js$/,
|
||||
minimize: true
|
||||
})
|
||||
]
|
||||
}
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user