forked from fossasia/open-event-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ember-cli-build.js
99 lines (93 loc) · 2.87 KB
/
ember-cli-build.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
/* eslint-env node */
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const MergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
const targets = require('./config/targets');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const env = process.env.EMBER_ENV || 'development';
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
'ember-cli-babel': {
includePolyfill: true
},
storeConfigInMeta : true,
sassOptions : {
sourceMapEmbed: true
},
SemanticUI: {
source: {
css : 'node_modules/@open-event/theme/dist',
javascript : 'node_modules/@open-event/theme/dist',
images : 'node_modules/@open-event/theme/dist/themes/default/assets/images',
fonts : 'node_modules/@open-event/theme/dist/themes/default/assets/fonts'
}
},
autoprefixer: {
overrideBrowserslist : targets.browsers,
enabled : true,
cascade : false,
sourcemap : true
},
minifyHTML: {
enabled : false,
htmlFiles : ['index.html', '404.html']
},
babel: {
plugins: [
'@babel/plugin-proposal-object-rest-spread',
require.resolve('ember-auto-import/babel-plugin')
],
targets,
sourceMaps: 'inline'
},
fingerprint: {
enabled : env === 'production',
generateAssetMap : true,
exclude : ['package.json', 'assets/moment-locales'],
extensions : ['js', 'css', 'png', 'jpg', 'gif', 'map', 'svg', 'json']
},
sourcemaps: {
enabled: true
},
autoImport: {
webpack: {
externals : { jquery: 'jQuery' },
plugins : process.env.ANALYE_BUNDLE === 'true' ? [
new BundleAnalyzerPlugin({
analyzerMode : 'static',
openAnalyzer : false,
generateStatsFile : true
})
] : [],
module: {
rules: [
{
test : /\.css$/i,
use : ['style-loader', 'css-loader']
}
]
}
}
}
});
app.import('node_modules/semantic-ui-calendar/dist/calendar.min.css');
app.import('node_modules/semantic-ui-calendar/dist/calendar.min.js', {
using: [{ transformation: 'fastbootShim' }]
});
app.import('node_modules/wysihtml/dist/wysihtml-toolbar.min.js', {
using: [{ transformation: 'fastbootShim' }]
});
app.import('node_modules/tinyColorPicker/jqColorPicker.min.js', {
using: [{ transformation: 'fastbootShim' }]
});
app.import('vendor/jquery-ui.min.js', {
using: [{ transformation: 'fastbootShim' }]
});
const appTree = app.toTree([]);
return new MergeTrees([appTree, new Funnel(appTree, {
files: ['index.html'],
getDestinationPath() {
return '404.html';
}
})]);
};