I’m looking into removing a dependency at build time based on an environmental variable from process.env.
Looked at a few things:
blacklist - doesn’t strip it from vendor.js
Prod code only? - Remove a particular file/folder from the app tree depends upon the build environment
Is there a way to remove a dependency at build time in either ember-cli-build
or does it have to be encapsulated in a separate addon?
efx
August 30, 2019, 5:24pm
2
I’ve done the inverse by only including a test file based on the environment:
// snippet from ember-cli-build
const environment = EmberApp.env();
const isTest = environment === 'test';
if (isTest) {
app.import('vendor/fixtures/my-test-file.csv', {type: 'test'});
}
This doesn’t answer your question directly but may help provide an opt-in scenario.
Where is the dependency coming from too? The app, node_modules
, or somewhere else?
This is wrong. blacklist
does strip it from vendor.js.
This is another good thing to know! Thank you!
1 Like