editor webpack merge

This commit is contained in:
Jiiks 2019-03-04 20:08:48 +02:00
parent e07b9b1550
commit 6b481733b9
3 changed files with 53 additions and 69 deletions

View File

@ -0,0 +1,38 @@
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const vueLoader = {
test: /\.(vue)$/,
exclude: /node_modules/,
use: 'vue-loader'
};
const scssLoader = {
test: /\.(css|scss)$/,
use: ['css-loader', 'sass-loader']
};
module.exports = {
entry: './src/index.js',
module: {
rules: [vueLoader, scssLoader]
},
externals: {
electron: 'window.require("electron")',
fs: 'window.require("fs")',
util: 'window.require("util")',
process: 'require("process")'
},
resolve: {
alias: {
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
},
modules: [
path.resolve('..', 'node_modules'),
path.resolve('..', 'common', 'modules')
]
},
plugins: [
new VueLoaderPlugin()
]
};

View File

@ -1,43 +1,16 @@
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const vueLoader = {
test: /\.(vue)$/,
exclude: /node_modules/,
use: 'vue-loader'
};
const baseconfig = require('./webpack.base.config');
const scssLoader = {
test: /\.(css|scss)$/,
use: ['css-loader', 'sass-loader']
};
const merge = require('webpack-merge');
const webpack = require('webpack');
module.exports = {
entry: './src/index.js',
const config = {
mode: 'development',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'editor.js'
},
module: {
rules: [vueLoader, scssLoader]
},
externals: {
electron: 'window.require("electron")',
fs: 'window.require("fs")',
util: 'window.require("util")',
process: 'require("process")'
},
resolve: {
alias: {
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
},
modules: [
path.resolve('..', 'node_modules'),
path.resolve('..', 'common', 'modules')
]
},
plugins: [
new VueLoaderPlugin()
]
}
};
module.exports = merge(baseconfig, config);

View File

@ -1,43 +1,16 @@
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const vueLoader = {
test: /\.(vue)$/,
exclude: /node_modules/,
use: 'vue-loader'
};
const baseconfig = require('./webpack.base.config');
const scssLoader = {
test: /\.(css|scss)$/,
use: ['css-loader', 'sass-loader']
};
const merge = require('webpack-merge');
const webpack = require('webpack');
module.exports = {
entry: './src/index.js',
const config = {
mode: 'production',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'editor.release.js'
},
module: {
rules: [vueLoader, scssLoader]
},
externals: {
electron: 'window.require("electron")',
fs: 'window.require("fs")',
util: 'window.require("util")',
process: 'require("process")'
},
resolve: {
alias: {
vue$: path.resolve('..', 'node_modules', 'vue', 'dist', 'vue.esm.js')
},
modules: [
path.resolve('..', 'node_modules'),
path.resolve('..', 'common', 'modules')
]
},
plugins: [
new VueLoaderPlugin()
]
filename: 'editor.js'
}
};
module.exports = merge(baseconfig, config);