sweetjs-loader

0.0.7 • Public • Published

sweetjs-loader

Use it like any other loader.

It takes a query string that contains sweetjs compiler options. The ones you most likely care about:

  • modules: a list of modules to load macros from
  • readers: a list of reader extension modules to install

example webpack.config.js

Applies the macros in macros.sjs to all .js files.

module.exports = {
  cache: true,
  entry: 'app.js',
  output: {
    filename: 'bundle.js'
  },
  module: {
    loaders: [{
      test: /\.js$/, loader: 'sweetjs?modules[]=./macros.sjs,readers[]=reader-mod'
    }]
  }
};

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.7
    83
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.7
    83
  • 0.1.0
    4
  • 0.0.5
    2
  • 0.0.0
    2

Package Sidebar

Install

npm i sweetjs-loader

Weekly Downloads

38

Version

0.0.7

License

Apache 2

Last publish

Collaborators

  • floydophone
  • jlongster