@Volodymyr_Smal-Stots wrote:
There is
sign-in
route in my project and I need to compile the route like a several file/s
- app
- routes
- sign-in.js
- templates
- sign-in.hbs
I am using
babel-plugin-ember-modules-api-polyfill
, because there are imports like thatimport { inject as service } from @ember/service
in thesign-in
route. The plugin transform their , for example, toEmber.Service
After compilation, when I open
dist/sign-in.js
in browser I get an errorIt because there are not any entities (Service, Mixin, Component, etc) in
Ember
objectBut when I run
ember s
and open application in Browser, I can get, for exampleEmber.Service
Do you know, how to import
Service
,Controller
,Component
and all Ember Classes like these?Thanks.
Gruntfile config:
grunt.loadNpmTasks('grunt-browserify'); .../ browserify: { loginPage: { options: { browserifyOptions: { debug: true, }, transform: [ "browserify-handlebars", ["babelify", { "presets": ['@babel/preset-env'], "plugins": ['@babel/proposal-class-properties', 'babel-plugin-ember-modules-api-polyfill'] }]], extensions: ['.js', '.hbs'] }, files: { 'dist/sign-in.js': ['app/routes/sign-in.js', 'app/templates/sign-in.hbs'] } },
Posts: 2
Participants: 2