Skip to content

Instantly share code, notes, and snippets.

@orekyuu
Created December 7, 2018 07:01
Show Gist options
  • Save orekyuu/906972be05e2be8788d9c58692bc8d5f to your computer and use it in GitHub Desktop.
Save orekyuu/906972be05e2be8788d9c58692bc8d5f to your computer and use it in GitHub Desktop.
inside
const path = require('path');
const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
entry: {
hoge: './src/main/js/files/hoge',
vendor: ['vue', 'vuex']
},
output: {
path: path.resolve(__dirname, 'build', 'classes', 'java', 'main', 'static', 'js'),
publicPath: '/js/',
filename: '[name].js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.(css|sass|scss)$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.js$/,
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env',
]
}
}
]
},
optimization: {
splitChunks: {
name: 'vendor',
chunks: 'initial',
}
},
plugins: [
new VueLoaderPlugin()
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment