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
- routes
I am using babel-plugin-ember-modules-api-polyfill
, because there are imports like that import { inject as service } from @ember/service
in the sign-in
route. The plugin transform their , for example, toEmber.Service
After compilation, when I open dist/sign-in.js
in browser I get an error
It because there are not any entities (Service, Mixin, Component, etc) in Ember
object
But when I run ember s
and open application in Browser, I can get, for example Ember.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']
}
},