i'm in process of porting existing aurelia app jspm/systemjs aurelia cli.
i'm having trouble getting babel-runtime
, associated transform work au build
. think problem due babel-runtime
dependency required in aurelia.json
- can't work out should be, looks following:
... { "name": "babel-runtime", "path": "../node_modules/babel-runtime", "main": "core-js", "resources": [ "./regenerator/index.js" ] } ...
i have following (relevant) devdependencies:
... "babel-plugin-syntax-flow": "^6.8.0", "babel-plugin-transform-async-to-generator": "^6.22.0", "babel-plugin-transform-builtin-extend": "^1.1.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-es2015-modules-amd": "^6.8.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.10.3", "babel-plugin-transform-es2015-modules-systemjs": "^6.9.0", "babel-plugin-transform-flow-strip-types": "^6.8.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-polyfill": "^6.23.0", "babel-preset-es2015": "^6.13.2", "babel-preset-stage-1": "^6.5.0", "babel-register": "^6.9.0" ...
and (relevant) dependencies:
"babel-runtime": "^6.23.0",
and .babelrc
:
{ "sourcemap": true, "moduleids": false, "comments": false, "compact": false, "code": true, "presets": [ ["es2015", {"loose": true}], "stage-1" ], "plugins": [ "syntax-flow", "transform-decorators-legacy", "transform-async-to-generator", ["transform-runtime", { "polyfill": false, "regenerator": true }], "transform-flow-strip-types", ["transform-builtin-extend", { "globals": ["array"] }] ] }
on au build
following class of errors:
file not found or not accessible: d:/code/.../node_modules/babel-runtime/regenerator.js. requested d:\code\... file not found or not accessible: d:/code/.../node_modules/core-js/library/fn/symbol.js. requested d:\code\...
could has set babel-runtime
in aurelia cli app please help?
update
i've managed build working listing babel-runtime
, core-js
dependencies seems reference....is correct approach?
{ "name": "babel-runtime", "path": "../node_modules/babel-runtime", "main": "core-js" }, { "name": "babel-runtime/regenerator", "path": "../node_modules/babel-runtime/regenerator", "main": "index" }, { "name": "babel-runtime/core-js", "path": "../node_modules/babel-runtime/core-js" }, { "name": "core-js", "path": "../node_modules/core-js", "main": "index" }, { "name": "core-js/library", "path": "../node_modules/core-js/library", "main": "index" }, { "name": "regenerator-runtime", "path": "../node_modules/regenerator-runtime", "main": "runtime-module" }, ...
however see runtime errors require seem indicate dependencies not being loaded in correct order
uncaught error: module name "_export" has not been loaded yet context: _. use require([]) uncaught error: module name "shim" has not been loaded yet context: _. use require([])
can this?
i have managed work....i started empty slate , added moving parts 1 one, there have been couple of updates aurelia cli i'm not entirely sure if doing wrong, or there issue in cli has been resolved.
my .babelrc
simple, stage-1 preset has enough make async transforms work:
{ "sourcemap": true, "moduleids": false, "comments": false, "compact": false, "code": true, "presets": [ ["es2015", {"loose": true}], "stage-1" ], "plugins": [ "transform-runtime", "transform-decorators-legacy" ] }
the core-js
, babel-runtime
related bundle dependencies in aurelia.json
are:
"dependencies": [ { "name": "core-js", "path": "../node_modules/core-js", "main": "client/core", "deps":[ "../node_modules/core-js/shim", "../node_modules/core-js/library/**/*.js", "../node_modules/core-js/modules/**/*.js" ] }, { "name": "regenerator-runtime", "path": "../node_modules/regenerator-runtime", "main": "runtime" }, { "name": "babel-runtime", "path": "../node_modules/babel-runtime", "main": "regenerator/index", "deps": [ "../node_modules/babel-runtime/core-js/**/*.js", "../node_modules/babel-runtime/helpers/**/*.js" ] }, { "name": "babel-runtime/regenerator", "path": "../node_modules/babel-runtime/regenerator", "main": "index" }, ...
and package.json relevant bits:
"dependencies": { ... "babel-runtime": "^6.23.0", "core-js": "^2.4.1", ... }, "devdependencies": { ... "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-es2015-modules-amd": "^6.8.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.10.3", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "^6.13.2", "babel-preset-stage-1": "^6.5.0", .... }
hope helps else trying make work!
Comments
Post a Comment