1
1
'use strict' ;
2
2
3
3
const EmberApp = require ( 'ember-cli/lib/broccoli/ember-app' ) ;
4
+ const SubresourceIntegrityPlugin = require ( 'webpack-subresource-integrity-embroider' ) ;
4
5
5
6
module . exports = function ( defaults ) {
6
7
const app = new EmberApp ( defaults , {
7
- autoImport : {
8
- forbidEval : true ,
9
- webpack : {
10
- externals : {
11
- // sjcl requires node's cryto library, which isn't needed
12
- // in Browser but causes webpack to bundle a portable version
13
- // which increases the build size by an inacceptable amount
14
- crypto : 'null' ,
15
- } ,
16
- } ,
17
- } ,
18
8
buildInfoOptions : {
19
9
metaTemplate : 'version={SEMVER}' ,
20
10
} ,
21
11
'ember-bootstrap' : {
22
12
importBootstrapCSS : false ,
23
13
bootstrapVersion : 4 ,
24
14
importBootstrapFont : false ,
25
- include : [
26
- 'bs-alert' ,
27
- 'bs-button' ,
28
- 'bs-button-group' ,
29
- 'bs-form' ,
30
- 'bs-modal' ,
31
- 'bs-tooltip' ,
32
- ] ,
33
15
} ,
34
16
'ember-cli-babel' : {
35
17
enableTypeScriptTransform : true ,
36
18
} ,
37
- 'ember-composable-helpers' : {
38
- only : [ 'array' , 'pick' ] ,
39
- } ,
40
- 'ember-math-helpers' : {
41
- only : [ 'lte' , 'sub' ] ,
42
- } ,
43
19
autoprefixer : {
44
20
browsers : [ 'last 2 ios version' ] ,
45
21
cascade : false ,
@@ -51,21 +27,37 @@ module.exports = function (defaults) {
51
27
} ,
52
28
} ) ;
53
29
54
- // Use `app.import` to add additional libraries to the generated
55
- // output files.
56
- //
57
- // If you need to use different assets in different
58
- // environments, specify an object as the first parameter. That
59
- // object's keys should be the environment name and the values
60
- // should be the asset to use in that environment.
61
- //
62
- // If the library that you are including contains AMD or ES6
63
- // modules that you would like to import into your application
64
- // please specify an object with the list of modules as keys
65
- // along with the exports of each module as its value.
66
-
67
30
app . import ( 'node_modules/open-iconic/font/fonts/open-iconic.ttf' ) ;
68
31
app . import ( 'node_modules/open-iconic/font/fonts/open-iconic.woff' ) ;
69
32
70
- return app . toTree ( ) ;
33
+ const { Webpack } = require ( '@embroider/webpack' ) ;
34
+ return require ( '@embroider/compat' ) . compatBuild ( app , Webpack , {
35
+ staticAddonTestSupportTrees : true ,
36
+ staticAddonTrees : true ,
37
+ staticHelpers : true ,
38
+ staticModifiers : true ,
39
+ staticComponents : true ,
40
+ // `ember-cli-deprecation-workflow` does not support `staticEmberSource = true`
41
+ // yet. See https://github.com/mixonic/ember-cli-deprecation-workflow/issues/156
42
+ // for details.
43
+ staticEmberSource : false ,
44
+ skipBabel : [
45
+ {
46
+ package : 'qunit' ,
47
+ } ,
48
+ ] ,
49
+ packagerOptions : {
50
+ webpackConfig : {
51
+ devtool : 'source-map' ,
52
+ plugins : [ new SubresourceIntegrityPlugin ( ) ] ,
53
+ resolve : {
54
+ fallback : {
55
+ // SJCL supports node.js as well using node's crypto module.
56
+ // We don't want it to be included in the bundle.
57
+ crypto : false ,
58
+ } ,
59
+ } ,
60
+ } ,
61
+ } ,
62
+ } ) ;
71
63
} ;
0 commit comments