Skip to content

Optibus/ember-webpack-loaders

 
 

Repository files navigation

Ember Webpack Loaders

A set of webpack loaders to help with ember integration.

Check the example app here: https://github.com/tulios/ember-webpack-example

Check the rails 5.1 app using these loaders https://github.com/rajibahmed/ember-react-webpack-rails-demo

Use VERSION 0.2.0 if you're using webpack1 https://github.com/tulios/ember-webpack-loaders/tree/0.2.0

Install

npm install ember-webpack-loaders

Usage

Apply this set of loaders to your webpack.config.js:

{
  module: {
    rules: [
      {
        test: /\.hbs$/,
        include: /app\/templates/, // or whatever directory you have
        loader: 'ember-webpack-loaders/htmlbars-loader'
      },
      {
        test: /app\/index\.js/, // the main app file
        use: [
            {
              loader: 'ember-webpack-loaders/inject-templates-loader',
              options: {
                appPath: './path/to/app',
              }
            },
            {
              loader: 'ember-webpack-loaders/inject-modules-loader',
              options: {
                appPath: './path/to/app',
              }
            }
         ],
       }
    ]
  }
}

Options

for ember-webpack-loaders/htmlbars-loader

  • appPath: Path for your ember app. Default assuming webpack.config.js in root folder and ./app
  • templateCompiler: default 'components-ember/ember-template-compiler.js'

for ember-webpack-loaders/inject-templates-loader

  • appPath: Path for your ember app. Default assuming webpack.config.js in root folder and ./app

for ember-webpack-loaders/inject-modules-loader

  • appPath: Path for your ember app. Default assuming webpack.config.js in root folder and ./app
  • appVar: Variable name of your Ember.Application. Default App

Example:

{
  module: {
    rules: [
      {
        test: /app\/index\.js/,
        use: [ 
          {
            loader: 'ember-webpack-loaders/inject-templates-loader'
          },
          {
            loader: 'ember-webpack-loaders/inject-modules-loader',
          }
        ],
        options: {
          appVar: 'MyProject'
        }
      }
    ]
  }
}

License

See LICENSE for more details.

About

a set of webpack loaders to help with ember integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%