-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
73 lines (70 loc) · 1.61 KB
/
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
// Global settings
module.exports = function () {
const sourcePath = 'src/';
const outputPath = 'preview/';
const svgFontName = 'IconFont';
const sourceFolders = {
scripts: 'js/',
styles: 'css/',
images: 'img/',
svg: 'svg/',
fonts: 'fonts/',
templates: 'templates/'
};
const outputFolders = {
scripts: 'js/',
styles: 'css/',
images: 'img/',
fonts: 'fonts/',
templates: ''
};
const assetsToLoad = {
vendorScripts: [
'node_modules/jquery/dist/jquery.js',
'node_modules/foundation-sites/dist/js/plugins/foundation.core.js',
'node_modules/foundation-sites/dist/js/plugins/foundation.util.mediaQuery.js'
],
scripts: [
sourcePath + sourceFolders.scripts + 'main.js'
],
styles: [
sourcePath + sourceFolders.styles + '**/*.sass'
],
images: [
sourcePath + sourceFolders.images + '**/*'
],
fonts: [
sourcePath + sourceFolders.fonts + '**/*'
],
templates: [
sourcePath + sourceFolders.templates + '**/*'
]
};
const webpackConfig = {
output: {
filename: '[name].bundle.js',
sourceMapFilename: '[name].bundle.map'
},
module: {
loaders: [
{
test: /.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}
]
}
};
const globalConfig = {
sourcePath: sourcePath,
outputPath: outputPath,
sourceFolders: sourceFolders,
outputFolders: outputFolders,
assetsToLoad: assetsToLoad,
svgFontName: svgFontName,
webpackConfig: webpackConfig
};
return globalConfig;
};