-
Notifications
You must be signed in to change notification settings - Fork 3
/
aoi.js
42 lines (34 loc) · 963 Bytes
/
aoi.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
var path = require('path');
var fs = require('fs');
var yaml = require('js-yaml');
function loadData() {
var RULES = /\.(yml|yaml)$/;
var buffer = "";
fs.readdirSync(path.resolve(__dirname, "data")).map(function(filename) {
if(RULES.test(filename)) {
buffer += "\n" + fs.readFileSync(path.resolve(__dirname, "data", filename))
}
})
return yaml.safeLoad(buffer);
}
module.exports = function(config, options) {
config.externals = {
"pixi.js": "PIXI"
}
config.module.loaders.push({
test: /\.(jpe?g|png|gif|svg|ico)$/i,
loaders: [
'file?name=[path][name].[ext]'//,
//'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
});
config.module.loaders.push({
test: /\.yaml$/,
include: path.resolve('data'),
loader: 'yaml',
})
config.slmLoader = {
data: loadData()
}
return config;
}