Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): resolve modules using node algorithm instead of hardcode #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const rollup = require('broccoli-rollup');
const rollupNodeResolve = require('rollup-plugin-node-resolve');
const rollupCommonjs = require('rollup-plugin-commonjs');
const rollupBabel = require('rollup-plugin-babel');
const resolvePackagePath = require('resolve-package-path');

let environment;

Expand All @@ -21,7 +22,11 @@ function maybeDebug(tree, name) {
}

function getMonacoEditorModulePath() {
var monacoEditorModulePath = 'node_modules/monaco-editor';
const monacoEditorModulePath = resolvePackagePath('monaco-editor')
.split('/')
.slice(0, -1)
.join('/');

return environment !== 'production'
? monacoEditorModulePath + '/dev/vs'
: monacoEditorModulePath + '/min/vs';
Expand Down Expand Up @@ -120,8 +125,13 @@ module.exports = {
'3-es-rollup'
);

const regeneratorPath = require.resolve('regenerator-runtime')
.split('/')
.slice(0, -1)
.join('/');

const regeneratorTree = maybeDebug(
new Funnel('node_modules/regenerator-runtime', {
new Funnel(regeneratorPath, {
include: ['runtime.js'],
destDir: '.'
}),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"ember-cli-typescript": "^2.0.0-rc.1",
"monaco-editor": "^0.16.0",
"penpal": "^3.0.7",
"resolve-package-path": "^1.2.7",
"rollup-plugin-babel": "^4.2.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0"
Expand Down