fly-webpack
Webpack plugin for Fly.
Last updated 4 years ago by andrewsokolov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fly-webpack 
SYNC missed versions from official npm registry.

Webpack plugin for Fly.

npm package

Usage

Check out the documentation to see the available options.

Install

npm install -D fly-webpack

Example

You can pass webpack options in with the first argument, including watch which will greatly decrease compilation times:

export default function* () {

    let webpackConfig = {
        watch: true,
        output: {
            path: 'public'
        }
    }

    yield this
        .source("src/main.js")
        .webpack(webpackConfig)
}

Or just pass in your webpack.config.js:

export default function* () {
    yield this
        .source("src/main.js")
        .webpack( require('./webpack.config.js') )
}

If you would like to use a different version of webpack than the one this plugin uses, pass in an optional 2nd argument:


import webpack from 'webpack'

export default function* () {
    yield this
        .source("src/main.js")
        .webpack( require('./webpack.config.js'),  webpack)
}

Pass in 3rd argument if you want to access the stats outputted from webpack when the compilation is done:

export default function* () {
    yield this
        .source("src/main.js")
        .webpack({
          /* config */
        }, null, (err, stats) => {
          /* Use stats to do more things if needed */
        })
}

Multiple Entry Points

A common request is how to handle multiple entry points. You can continue to pass in an entry option in your typical webpack config like so:

export default function* () {
    yield this
        .source("src/main.js")
        .webpack({
                   entry: {
                           app: 'src/app.js',
                           test: 'test/test.js',
                   },
                   output: {
                       filename: '[name].js',
                   }
               })
}

Or you can handle this with passing multiple files to source like so:

export default function* () {
    yield this
        .source(["src/app.js", "test/test.js"])
        .webpack({
                   output: {
                       filename: '[name].js',
                   }
               })
}

Release History

  • 1.0.9 - Update fly to 0.8.2
  • 1.0.8 - Add more tests
  • 1.0.6 - Add support for node@0.11
  • 1.0.5 - Add tests
  • 1.0.3 - Initial release

License

MIT © Andrew Sokolov et al

Current Tags

  • 1.1.1                                ...           latest (4 years ago)

13 Versions

  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dev Dependencies (9)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |