Skip to content

Instantly share code, notes, and snippets.

@matthew798
Created November 1, 2019 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthew798/93cbbed49debdeb9e24c6fb56a7bf43c to your computer and use it in GitHub Desktop.
Save matthew798/93cbbed49debdeb9e24c6fb56a7bf43c to your computer and use it in GitHub Desktop.
weback config for issue
const path = require('path');
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
module.exports = {
entry: {
editor: path.resolve(__dirname, './src/js/FormrEditor.js'),
renderer: path.resolve(__dirname, './src/js/FormrRenderer.js')
},
output: {
filename: 'formr-[name].js',
path: path.resolve(__dirname, 'dist/js'),
library: 'Formr',
libraryTarget: "umd"
},
devtool: "source-map",
mode: "development",
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: '/node_modules/',
query: {
presets: ['@babel/env'],
plugins: [
'lodash',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods'
]
}
},
{
test: /\.svg$/,
loader: 'svg-sprite-loader'
}
],
},
//optimization: {
// splitChunks: {
// chunks: 'all',
// },
//},
plugins: [
new SpriteLoaderPlugin(),
new LodashModuleReplacementPlugin(),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment