Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
// replace "style-loader" w/ "vue-style-loader"
config.module.rules.forEach(obj => {
if (Array.isArray(obj.use)) {
obj.use = obj.use.map(x => x === 'style-loader' ? 'vue-style-loader' : x);
}
});
config.module.rules.unshift({
test: /\.vue$/,
loader: 'vue-loader'
});
config.plugins.push(
new VueLoaderPlugin({
productionMode: opts.production
})
);
}
const { environment } = require('@rails/webpacker')
const coffee = require('./loaders/coffee')
const { VueLoaderPlugin } = require('vue-loader')
const vue = require('./loaders/vue')
// resolve-url-loader must be used before sass-loader
environment.loaders.get('sass').use.splice(-1, 0, {
loader: 'resolve-url-loader'
});
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
environment.loaders.prepend('vue', vue)
environment.loaders.prepend('coffee', coffee)
module.exports = environment
// name: 'vendor-commons',
// chunks: 'initial'
// }
// }
// }
// }
// })
// })
environment.plugins.append('Provide', new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default']
}))
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
environment.loaders.prepend('vue', vue)
environment.plugins.append('ContextReplacement',
new webpack.ContextReplacementPlugin(
/moment[\/\\]locale$/,
/ja|en-SG|en-au|en-ca|en-gb|en-ie|en-il|en-nz|de|fr|fu|zh-tw|zh-cn|zh-hk/
)
)
module.exports = environment
const { environment } = require('@rails/webpacker')
const { VueLoaderPlugin } = require('vue-loader')
const vue = require('./loaders/vue')
const path = require('path')
environment.config.merge({
resolve: {
alias: {
'@': path.resolve('app/javascript'),
vue$: 'vue/dist/vue.runtime.esm.js',
},
},
})
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
environment.loaders.prepend('vue', vue)
module.exports = environment
const webpack = require('webpack');
const config = require('./config');
const CompressionPlugin = require("compression-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { VueLoaderPlugin } = require('vue-loader');
let plugins = [];
plugins.push(new VueLoaderPlugin());
if(config.build.sourceMap){
plugins.push(new webpack.SourceMapDevToolPlugin({
filename: '[name].map'
}))
}
plugins.push(new webpack.DefinePlugin({
'process.env': {
NODE_ENV: config.build.env
}
}));
if(config.build.gzip){
plugins.push(new CompressionPlugin({
const { environment } = require('@rails/webpacker')
const { VueLoaderPlugin } = require('vue-loader')
const vue = require('./loaders/vue')
const pug = require('./loaders/pug')
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
environment.loaders.prepend('vue', vue)
environment.loaders.prepend('pug', pug)
module.exports = environment
createWebpackPlugins() {
const plugins = [];
plugins.push(new vue_loader_1.VueLoaderPlugin());
if (Object.keys(this.variables.env).length > 0) {
plugins.push(new webpack.EnvironmentPlugin(this.variables.env));
}
return plugins;
}
createWebpackRules() {
const { environment } = require('@rails/webpacker')
const { VueLoaderPlugin } = require('vue-loader')
const vue = require('./loaders/vue')
const resolveAliases = require('./resolve_aliases')
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
environment.loaders.prepend('vue', vue)
environment.config.merge(resolveAliases)
module.exports = environment
function getEntryConfig (name, analyzerPort, alias = {}) {
let plugins = [
new VueLoaderPlugin(),
new webpack.IgnorePlugin(/jsdom$/),
new FriendlyErrorsWebpackPlugin(),
new WebpackNotifierPlugin(),
new MiniCssExtractPlugin({
filename: production ? 'css/[name].[chunkhash].css' : 'css/[name].css'
}),
new ManifestPlugin({
fileName: `manifest-${name}.json`,
publicPath,
writeToFileEmit: true
})
]
if (production) {
plugins.push(...[
new BundleAnalyzerPlugin({
const webpack = require('webpack');
const config = require('./config');
const CompressionPlugin = require("compression-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { VueLoaderPlugin } = require('vue-loader');
let plugins = [];
plugins.push(new VueLoaderPlugin());
if(config.build.sourceMap){
plugins.push(new webpack.SourceMapDevToolPlugin({
filename: '[name].map'
}))
}
plugins.push(new webpack.DefinePlugin({
'process.env': {
NODE_ENV: config.build.env
}
}));
if(config.build.gzip){
plugins.push(new CompressionPlugin({