Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit c6ee3ec

Browse files
Do not use ember-cli-node-assets for imports (#138)
1 parent 2217809 commit c6ee3ec

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018
3+
Copyright (c) 2020
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

index.js

+7-16
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ module.exports = {
2323
}
2424

2525
if (theme && theme !== 'none') {
26-
this.theme = `themes/prism-${theme}.css`;
26+
app.import(`node_modules/prismjs/themes/prism-${theme}.css`);
27+
} else {
28+
app.import(`node_modules/prismjs/themes/prism.css`);
2729
}
2830

31+
app.import('node_modules/prismjs/prism.js');
32+
2933
if (components) {
3034
components.forEach((component) => {
31-
this.components.push(`components/prism-${component}.js`);
35+
app.import(`node_modules/prismjs/components/prism-${component}.js`);
3236
});
3337
}
3438

@@ -51,9 +55,8 @@ module.exports = {
5155
const nodeAssetsPath = `plugins/${plugin}/prism-${plugin}.${fileExtension}`;
5256
const file = `node_modules/prismjs/${nodeAssetsPath}`;
5357

54-
5558
if (fs.existsSync(file)) {
56-
this.plugins.push(nodeAssetsPath);
59+
app.import(file);
5760
}
5861
});
5962

@@ -64,18 +67,6 @@ module.exports = {
6467
app.import('vendor/ember-prism.js');
6568

6669
this._super.included.apply(this, arguments);
67-
},
68-
options: {
69-
nodeAssets: {
70-
prismjs() {
71-
return {
72-
import: [
73-
'prism.js',
74-
this.theme
75-
].concat(this.components, this.plugins)
76-
};
77-
}
78-
}
7970
}
8071
};
8172

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"@ember/render-modifiers": "^1.0.2",
3838
"ember-cli-babel": "^7.19.0",
3939
"ember-cli-htmlbars": "^5.1.1",
40-
"ember-cli-node-assets": "^0.2.2",
4140
"prismjs": "^1.19.0"
4241
},
4342
"devDependencies": {

yarn.lock

+3-15
Original file line numberDiff line numberDiff line change
@@ -3307,7 +3307,7 @@ broccoli-kitchen-sink-helpers@^0.3.1:
33073307
glob "^5.0.10"
33083308
mkdirp "^0.5.1"
33093309

3310-
broccoli-merge-trees@^1.0.0, broccoli-merge-trees@^1.1.1:
3310+
broccoli-merge-trees@^1.0.0:
33113311
version "1.2.4"
33123312
resolved "https://registry.yarnpkg.com/broccoli-merge-trees/-/broccoli-merge-trees-1.2.4.tgz#a001519bb5067f06589d91afa2942445a2d0fdb5"
33133313
integrity sha1-oAFRm7UGfwZYnZGvopQkRaLQ/bU=
@@ -5046,18 +5046,6 @@ ember-cli-lodash-subset@^2.0.1:
50465046
resolved "https://registry.yarnpkg.com/ember-cli-lodash-subset/-/ember-cli-lodash-subset-2.0.1.tgz#20cb68a790fe0fde2488ddfd8efbb7df6fe766f2"
50475047
integrity sha1-IMtop5D+D94kiN39jvu332/nZvI=
50485048

5049-
ember-cli-node-assets@^0.2.2:
5050-
version "0.2.2"
5051-
resolved "https://registry.yarnpkg.com/ember-cli-node-assets/-/ember-cli-node-assets-0.2.2.tgz#d2d55626e7cc6619f882d7fe55751f9266022708"
5052-
integrity sha1-0tVWJufMZhn4gtf+VXUfkmYCJwg=
5053-
dependencies:
5054-
broccoli-funnel "^1.0.1"
5055-
broccoli-merge-trees "^1.1.1"
5056-
broccoli-source "^1.1.0"
5057-
debug "^2.2.0"
5058-
lodash "^4.5.1"
5059-
resolve "^1.1.7"
5060-
50615049
ember-cli-normalize-entity-name@^1.0.0:
50625050
version "1.0.0"
50635051
resolved "https://registry.yarnpkg.com/ember-cli-normalize-entity-name/-/ember-cli-normalize-entity-name-1.0.0.tgz#0b14f7bcbc599aa117b5fddc81e4fd03c4bad5b7"
@@ -8321,7 +8309,7 @@ lodash.uniqby@^4.7.0:
83218309
resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302"
83228310
integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=
83238311

8324-
[email protected], lodash@^4.17.10, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4, lodash@^4.5.1, lodash@^4.6.1:
8312+
[email protected], lodash@^4.17.10, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4, lodash@^4.6.1:
83258313
version "4.17.20"
83268314
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
83278315
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
@@ -10431,7 +10419,7 @@ [email protected]:
1043110419
dependencies:
1043210420
path-parse "^1.0.6"
1043310421

10434-
resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.7.1, resolve@^1.8.1:
10422+
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.7.1, resolve@^1.8.1:
1043510423
version "1.17.0"
1043610424
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
1043710425
integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==

0 commit comments

Comments
 (0)