-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
70 lines (62 loc) · 1.56 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
// Require path.
const path = require( 'path' );
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const { VueLoaderPlugin } = require('vue-loader');
const proxy_url = "https://wildcard:8890";
// Configuration object.
const config = {
// Create the entry points.
// One for frontend and one for the admin area.
entry: {
// frontend and admin will replace the [name] portion of the output config below.
main: './src/frontend/frontend.js',
},
// Create the output files.
// One for each of our entry points.
output: {
// [name] allows for the entry object keys to be used as file names.
filename: 'js/[name].js',
// Specify the path to the JS files.
path: path.resolve( __dirname, 'dist' )
},
plugins: [
new VueLoaderPlugin(),
new BrowserSyncPlugin({
// browse to http://localhost:3000/ during development,
// ./public directory is being served
host: 'localhost',
port: 3000,
proxy: proxy_url
})
],
resolve: {
extensions: ['.js', '.vue', '.css']
},
// Setup a loader to transpile down the latest and great JavaScript so older browsers
// can understand it.
module: {
rules: [
{
// Look for any .js files.
test: /\.js$/,
// Exclude the node_modules folder.
exclude: /node_modules/,
// Use babel loader to transpile the JS files.
loader: 'babel-loader'
},
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
}
],
}
}
// Export the config object.
module.exports = config;