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 path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const vueLoader = { const baseconfig = require('./webpack.base.config');
test: /\.(vue)$/,
exclude: /node_modules/,
use: 'vue-loader'
};
const scssLoader = { const merge = require('webpack-merge');
test: /\.(css|scss)$/, const webpack = require('webpack');
use: ['css-loader', 'sass-loader']
};
module.exports = { const config = {
entry: './src/index.js',
mode: 'development', mode: 'development',
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'editor.js' 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 path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const vueLoader = { const baseconfig = require('./webpack.base.config');
test: /\.(vue)$/,
exclude: /node_modules/,
use: 'vue-loader'
};
const scssLoader = { const merge = require('webpack-merge');
test: /\.(css|scss)$/, const webpack = require('webpack');
use: ['css-loader', 'sass-loader']
};
module.exports = { const config = {
entry: './src/index.js',
mode: 'production', mode: 'production',
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'editor.release.js' 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);