Skip to content
Permalink
Browse files

feat(package): use ember-auto-import

  • Loading branch information...
devinus committed Nov 27, 2018
1 parent ed2db80 commit 3beb16e783e2742915fd7d01efda2c04d16bfd4a
Showing with 30 additions and 378 deletions.
  1. +2 −1 config/targets.js
  2. +4 −73 ember-cli-build.js
  3. +1 −1 ember-electron/electron-forge-config.js
  4. +2 −4 package.json
  5. +21 −299 yarn.lock
@@ -12,7 +12,8 @@ if (isElectron) {
browsers.push('last 2 Chrome versions');

const isCI = !!process.env.CI;
if (!isCI) {
const isProduction = process.env.EMBER_ENV === 'production';
if (isCI || isProduction) {
browsers.push(
'last 2 Safari versions',
'last 2 Firefox versions',
@@ -1,25 +1,19 @@
/* eslint-env node */
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const json = require('rollup-plugin-json');
const nodeGlobals = require('rollup-plugin-node-globals');
const nodeBuiltins = require('rollup-plugin-node-builtins');
const { extensions: defaultExtensions } = require('broccoli-asset-rev/lib/default-options');

module.exports = (defaults) => {
const isProduction = EmberApp.env() === 'production';
const isElectron = !!process.env.EMBER_CLI_ELECTRON;
const app = new EmberApp(defaults, {
babel: {
sourceMaps: 'inline',
sourceMaps: isProduction ? false : 'inline',
plugins: [
'@babel/plugin-proposal-function-bind',
'@babel/plugin-proposal-throw-expressions',
],
},

sourcemaps: {
enabled: EmberApp.env() !== 'production',
extensions: ['js'],
},

fingerprint: {
extensions: defaultExtensions.concat([
'svg',
@@ -50,7 +44,7 @@ module.exports = (defaults) => {
},

'ember-service-worker': {
enabled: EmberApp.env() === 'production' && !process.env.EMBER_CLI_ELECTRON,
enabled: isProduction && !isElectron,
versionStrategy: 'every-build',
registrationStrategy: 'async',
},
@@ -104,68 +98,5 @@ module.exports = (defaults) => {
app.import('vendor/slick-carousel/slick.css');
app.import('vendor/slick-carousel/slick-theme.css');

app.import('node_modules/coinmarketcap/lib/index.js', {
using: [
{
transformation: 'cjs',
as: 'coinmarketcap',
plugins: [
nodeBuiltins(),
],
},
],
});

app.import('node_modules/bignumber.js/bignumber.js', {
using: [
{ transformation: 'amd', as: 'bignumber.js' },
],
});

app.import('node_modules/bip39/index.js', {
using: [
{
transformation: 'cjs',
as: 'bip39',
plugins: [
json(),
nodeGlobals(),
nodeBuiltins(),
],
},
],
});

app.import('node_modules/locale2/index.js', {
using: [
{ transformation: 'cjs', as: 'locale2' },
],
});

app.import('node_modules/nanoid/index.browser.js', {
using: [
{
transformation: 'cjs',
as: 'nanoid',
plugins: [
nodeGlobals(),
nodeBuiltins(),
],
},
],
});

app.import('node_modules/speedometer/index.js', {
using: [
{ transformation: 'cjs', as: 'speedometer' },
],
});

app.import('node_modules/downloadjs/download.js', {
using: [
{ transformation: 'amd', as: 'downloadjs' },
],
});

return app.toTree();
};
@@ -111,7 +111,7 @@ module.exports = {
OriginalFilename: `${name}.exe`,
ProductName: productName,
},
afterPrune: [
afterCopy: [
(buildPath, electronVersion, platform, arch, callback) => {
const cwd = path.join(buildPath, 'node_modules', 'lzma-native');
return del(['{deps,build}', 'bin/**'], { cwd })
@@ -163,6 +163,7 @@
"electron-packager": "^12.2.0",
"electron-prebuilt-compile": "3.0.10",
"ember-ajax": "^4.0.0",
"ember-auto-import": "^1.2.16",
"ember-bootstrap": "^2.3.0",
"ember-bootstrap-changeset-validations": "^1.0.0",
"ember-bootstrap-power-select": "^1.0.0",
@@ -175,7 +176,6 @@
"ember-cli-babel": "^7.1.3",
"ember-cli-build-notifications": "^0.4.0",
"ember-cli-chai": "^0.5.0",
"ember-cli-cjs-transform": "^1.3.0",
"ember-cli-clipboard": "^0.10.0",
"ember-cli-content-for-config": "^1.1.0",
"ember-cli-content-security-policy": "^1.0.0",
@@ -258,11 +258,9 @@
"patch-package": "^6.0.0-11",
"postinstall-postinstall": "^2.0.0",
"rimraf": "^2.6.2",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"sass": "^1.15.1",
"slick-carousel": "^1.8.1",
"speedometer": "^1.1.0",
"standard-version": "^4.4.0"
},
"resolutions": {
Oops, something went wrong.

0 comments on commit 3beb16e

Please sign in to comment.
You can’t perform that action at this time.