-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.js
100 lines (94 loc) · 2.24 KB
/
webpack.config.js
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
94
95
96
97
98
99
100
var path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ConfigWebpackPlugin = require("config-webpack");
module.exports = {
// This is the "main" file which should include all other modules
entry: './src/main.js',
// Where should the compiled file go?
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js'
},
mode: 'none',
resolve: {
alias: {
vue: 'vue/dist/vue.js'
}
},
module: {
// Special compilation rules
rules: [
// babel
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
// css
{
test: /\.css$/,
loader: "style-loader!css-loader" ,
// exclude: /node_modules/
},
// scss
{
test: /\.s[ac]ss$/i,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: function () {
return [
require('autoprefixer')
];
}
}
},
'sass-loader',
],
exclude: /node_modules/
},
// fonts
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file-loader?name=public/fonts/[name].[ext]',
exclude: /node_modules/
},
// vue
{
test: /\.vue$/,
loader: 'vue-loader',
exclude: /(node_modules|bower_components)/,
},
// images
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
bypassOnDebug: true,
},
},
],
},
]
},
devServer: {
port: 3000
},
plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
title: 'LifeScope XR Gallery',
// Load a custom template (lodash by default see the FAQ for details)
template: './src/index.html'
}),
new ConfigWebpackPlugin()
]
};