@kpdecker/linoleum-webpack
Webpack build infrastructure for Linoleum projects
Last updated 3 years ago by kpdecker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @kpdecker/linoleum-webpack 
SYNC missed versions from official npm registry.

Linoleum-Webpack

Webpack build infrastructure for Linoleum projects.

Usage

Within Gulpfile.js:

// Init global state
var Linoleum = require('@kpdecker/linoleum');

// Include optional linoleum tasks
var LinoleumWebpack = require('@kpdecker/linoleum-webpack');

Global APIs:

  • CLIENT_ENTRY: Path to the client build entry point
  • KARMA_TEST_FILES: Glob representing karma test files. May be overridden. Will be ignored from mocha tests.
  • SERVER_PORT: Port that the webpack dev server instance will proxy.
  • DEV_SERVER_PORT: Port that the webpack dev server will be hosted on.

(Added to the Linoleum root project)

Defines:

  • webpack task which generates webpack build packages. This includes:

    • lib/$client$/: Web client package
    • lib/index.js: Node server package
    • lib/$cover$/: Test coverage node package

    This is intended to replace the babel build tasks for projects using Webpack, not augment them.

  • webpack:dev-server task which launches a webpack developer server instance

  • watch:karma task which runs Karma tests in watch mode.

  • cover:server task which runs webpack coverage tests in node.

  • cover:web task which runs webpack coverage tests in browser.

For webpack tests, each package will filter the tests that are imported based on the file suffix. .server.js tests will only run under the cover:server task and .web.js tests will only run under the cover:web task. Simple .js files will run under both.

When running in watch mode, the optional LinoleumWebpack.watchHandler change handler can be used to ensure that rebuilds always invalidate. Depending on the exact OS, Editor, and Node versions in use, the default configuration might not always trigger.

Linoleum.watch(WATCH_FILES, 'build', {
  onChange: LinoleumWebpack.watchHandler
});

Common issues

Karma

Travis needs to be configured to use Firefox when running Karma tests. This can be done with the following config:

before_script:
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - sleep 3 # give xvfb some time to start

If a Error: Path doesn't exist '/_karma_webpack_/karma-test.js' or similar is seen when running Karma, this is due to the Karma tests directory not existing.

Current Tags

  • 3.2.1                                ...           latest (3 years ago)

19 Versions

  • 3.2.1                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.8.0                                ...           3 years ago
  • 2.7.0                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.0                                ...           3 years ago
  • 2.4.0                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 57
Last Day 0
Last Week 57
Last Month 4
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |