/* * here using hoisting so don't use `var NAME = function()...` */ function getImplicitGlobals() { return new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', jquery: 'jquery', }); }
(function () { var plugins = []; switch (NODE_ENV) { case 'development': plugins.push( new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin() ); // fall through to case 'production': plugins.push( new webpack.ProvidePlugin({ 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch/fetch' }) ); } return plugins; })()
const getPlugins = function (config) { var plugins = [].concat(config.plugins) plugins.push(new webpack.DefinePlugin(_.extend({ ELF_ENV: JSON.stringify(config.ELF_ENV) }, config.definePluginOptions))) plugins.push(new HeadJavascriptInjectPlugin()) plugins.push(new webpack.ProvidePlugin({ $: zeptoPath, Zepto: zeptoPath, 'window.Zepto': zeptoPath })) config.enableWebpackVisualizer && plugins.push(new Visualizer({ filename: './webpack-stats.html' })) addHtmlWebpackPlugins(plugins, config.htmlWebpackPluginOptions) addCommonChunkPlugins(plugins, config.commonsChunkPluginOptions) return plugins }
gulp.task('webpack', () => { return gulp .src('src/App.js') .pipe(webpack({ entry: './src/App.jsx', output: { filename: 'bundle.js' }, module: { loaders: [ { test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/, query: { presets: ['es2015', 'react'] } } ] }, plugins: [ new wp.ProvidePlugin({ 'Promise': 'exports?module.exports.Promise!es6-promise', 'fetch': 'imports?self=>global!exports?global.fetch!isomorphic-fetch' }) ] })) .pipe(gulp.dest('./dist')); });
SENTRY_DSN: JSON.stringify(config.sentry.dns) }), new webpack.ProvidePlugin({ Promise: "imports-loader?this=>global!exports-loader?global.Promise!es6-promise", fetch: "exports-loader?self.fetch!whatwg-fetch/dist/fetch.umd"
new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery',
}, plugins: [ new webpack.ProvidePlugin({ 'window.Quill': 'quill/dist/quill.js', 'Quill': 'quill/dist/quill.js'
}) ] : []) .concat(isTest ? [] : new webpack.ProvidePlugin({ fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch' }))
new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery',
/* * here using hoisting so don't use `var NAME = function()...` */ function getImplicitGlobals() { return new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', }); }
/* * here using hoisting so don't use `var NAME = function()...` */ function getImplicitGlobals() { return new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', jquery: 'jquery', }); }
}, plugins: [ new webpack.ProvidePlugin({ 'window.Quill': 'quill/dist/quill.js', 'Quill': 'quill/dist/quill.js'