diff options
Diffstat (limited to 'plugins/jetpack/jetpack_vendor/automattic/jetpack-lazy-images/webpack.config.js')
-rw-r--r-- | plugins/jetpack/jetpack_vendor/automattic/jetpack-lazy-images/webpack.config.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/jetpack/jetpack_vendor/automattic/jetpack-lazy-images/webpack.config.js b/plugins/jetpack/jetpack_vendor/automattic/jetpack-lazy-images/webpack.config.js new file mode 100644 index 00000000..4d5d2bdb --- /dev/null +++ b/plugins/jetpack/jetpack_vendor/automattic/jetpack-lazy-images/webpack.config.js @@ -0,0 +1,43 @@ +const jetpackWebpackConfig = require( '@automattic/jetpack-webpack-config/webpack' ); +const path = require( 'path' ); +const CopyWebpackPlugin = require( 'copy-webpack-plugin' ); + +module.exports = [ + { + entry: { + 'lazy-images': './src/js/lazy-images.js', + 'intersection-observer': require.resolve( 'intersection-observer/intersection-observer.js' ), + }, + mode: jetpackWebpackConfig.mode, + devtool: jetpackWebpackConfig.devtool, + output: { + ...jetpackWebpackConfig.output, + path: path.resolve( './dist' ), + }, + optimization: { + ...jetpackWebpackConfig.optimization, + }, + resolve: { + ...jetpackWebpackConfig.resolve, + }, + node: false, + plugins: [ + ...jetpackWebpackConfig.StandardPlugins(), + new CopyWebpackPlugin( { + patterns: [ + { + from: require.resolve( 'intersection-observer/intersection-observer.js' ), + to: 'intersection-observer.src.js', + }, + ], + } ), + ], + module: { + strictExportPresence: true, + rules: [ + // Transpile JavaScript, including node_modules. + jetpackWebpackConfig.TranspileRule(), + ], + }, + }, +]; |