-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.babel.js
More file actions
76 lines (63 loc) · 1.42 KB
/
webpack.config.babel.js
File metadata and controls
76 lines (63 loc) · 1.42 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
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
import webpack from 'webpack';
import path from 'path';
export default {
entry: [
path.resolve(__dirname, 'app/frontend/index.js'),
path.resolve(__dirname, 'app/frontend/static/manifest.js')
],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/],
},
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
]
},
{
test: /\.svg$/,
use: 'url-loader?limit=102400&name=[name]-[hash:base64].[ext]',
}
]
},
resolve: {
modules: [
path.resolve('./app/frontend/components/'),
path.resolve('./node_modules/')
],
alias: {
'vue$': 'vue/dist/vue.common.js' // VueJS standalone
},
// So that we can import components without their index.vue files
extensions: ['.js', '.css', '.vue']
},
plugins: [
new webpack.ProvidePlugin({
_: 'lodash',
$: 'jquery',
jquery: 'jquery'
}),
new webpack.DefinePlugin({
API_URL: JSON.stringify('http://localhost:3000')
})
],
devServer: {
contentBase: path.join(__dirname, 'build'),
port: 9000
}
}