-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
93 lines (88 loc) · 2.46 KB
/
Copy pathwebpack.config.js
File metadata and controls
93 lines (88 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
const path = require('path');
// var JsDocPlugin = require('jsdoc-webpack-plugin-v2');
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
// runtimeCompiler: true,
entry: './src/index.js',
// output: {
// filename: 'index.js',
// path: path.resolve(__dirname, 'dist'),
// globalObject: "this"
// },
output: {
filename: 'index.js',
library: 'fluro-vue',
libraryTarget: 'umd',
libraryExport: 'default',
path: path.resolve(__dirname, 'dist'),
globalObject: 'typeof self !== \'undefined\' ? self : this',
},
externals: {
'vue': 'vue',
'fluro': 'fluro',
'vuex-map-fields': 'vuex-map-fields',
'lodash': {
commonjs: 'lodash',
commonjs2: 'lodash',
amd: 'lodash',
root: '_'
},
},
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader'
},
// this will apply to both plain `.js` files
// AND `<script>` blocks in `.vue` files
{
test: /\.js$/,
loader: 'babel-loader'
},
// {
// test: /\.scss$/,
// loader: 'sass-loader'
// },
// this will apply to both plain `.css` files
// AND `<style>` blocks in `.vue` files
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
'vue-style-loader',
// Translates CSS into CommonJS
'css-loader',
// Compiles Sass to CSS
'sass-loader',
],
},
]
},
// resolve: {
// alias: {
// // allows to use the compiler
// // without this, cli will overload the alias and use runtime esm
// vue$: 'vue/dist/vue.esm.js',
// // '@': path.resolve(__dirname, '../src'),
// },
// },
plugins: [
new VueLoaderPlugin()
],
// plugins: [
// new JsDocPlugin(
// // {
// // conf:path.join(__dirname, 'jsdoc.json'),
// // }
// )
// ],
optimization: {
splitChunks: {
chunks: 'all'
}
},
// output: {
// filename: 'main.js',
// path: path.resolve(__dirname, 'dist')
// }
};