File "webpack.config.js"
Full Path: /home/warrior1/public_html/languages/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-my-jetpack/webpack.config.js
File size: 1.3 KB
MIME-type: text/plain
Charset: utf-8
const path = require( 'path' );
const jetpackWebpackConfig = require( '@automattic/jetpack-webpack-config/webpack' );
module.exports = [
{
entry: {
index: './_inc/admin.jsx',
},
mode: jetpackWebpackConfig.mode,
devtool: jetpackWebpackConfig.isDevelopment ? 'source-map' : false,
output: {
...jetpackWebpackConfig.output,
path: path.resolve( './build' ),
},
optimization: {
...jetpackWebpackConfig.optimization,
},
resolve: {
...jetpackWebpackConfig.resolve,
},
node: false,
plugins: [
...jetpackWebpackConfig.StandardPlugins( {
DependencyExtractionPlugin: { injectPolyfill: true },
} ),
],
module: {
strictExportPresence: true,
rules: [
// Transpile JavaScript
jetpackWebpackConfig.TranspileRule( {
exclude: /node_modules\//,
} ),
// Transpile @automattic/jetpack-* in node_modules too.
jetpackWebpackConfig.TranspileRule( {
includeNodeModules: [ '@automattic/jetpack-' ],
} ),
// Handle CSS.
jetpackWebpackConfig.CssRule( {
extensions: [ 'css', 'sass', 'scss' ],
extraLoaders: [ 'sass-loader' ],
} ),
// Handle images.
jetpackWebpackConfig.FileRule(),
],
},
externals: {
...jetpackWebpackConfig.externals,
jetpackConfig: JSON.stringify( {
consumer_slug: 'my_jetpack',
} ),
},
},
];