A webpack loader for sweetjs
JavaScript
Latest commit e3eb946 Dec 30, 2015 @jlongster 0.0.7
Permalink
Failed to load latest commit information.
test Finish test case Mar 19, 2014
.gitignore First pass Mar 19, 2014
README.md rename readtables to readers Jul 3, 2014
index.js pass through parameter readableNames to sweet.js compiler Aug 12, 2015
package.json 0.0.7 Dec 30, 2015

README.md

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'
    }]
  }
};