@crasman/stage-webpack
Webpack configs and scripts for Stage / Studio
Last updated 2 months ago by phcras .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @crasman/stage-webpack 
SYNC missed versions from official npm registry.

stage-webpack

Webpack bundling processes desgined to work well with Stage / Studio environment

Installation

This is installed automatically if you use @crasman/create-stage-webpack to create new project, also the configuration is taken care of.

To install manually run npm install stage-webpack --save-dev

Configuration

Config file (stage-webpack.config.js) needs to be found in project root folder. See config documentation

You also need to setup linters and build process configuration. Click links for examples on how to use and extend stage-webpack defaults:

These files should be stored in the root of your project.

Service worker setup

If defined (config.files.serviceWorker), we expect to find self.__WB_MANIFEST in the service worker file for precaching built assets. Example service-worker.js setup

Extending stage-webpack.config.js

You can extend project settings with local ones by placing another stage-webpack.config.js file outside of the project folder. This way you can generate valid SSL certificate that you can use for all your stage-webpack dev servers.

Scripts

  • stage-webpack-scripts start: Start dev server. Change proxy target with --sw-stage-url <config.stage.urls[target]>. E.g. stage-webpack-scripts start --sw-stage-url admin
  • stage-webpack-scripts build: Build files and upload to Studio
  • stage-webpack-scripts watch: Dev version of build. Should only be used when dev server can't be used, for example when developing Prince XML which requires that server has access to needed files.

Client environment variables

Exposed to client:

  • PUBLIC_PATH: Can be used to register service worker etc.
  • NODE_ENV: production, development, test
  • SW_<anything>: Any env variable prefixed with SW_ can be used in client code. E.g SW_TEST = 'test' can be accessed with process.env.SW_TEST

Current Tags

  • 1.6.0                                ...           latest (2 months ago)
  • 0.1.0-0                                ...           next (3 months ago)

21 Versions

  • 1.6.0                                ...           2 months ago
  • 1.5.2                                ...           2 months ago
  • 1.5.1                                ...           2 months ago
  • 1.5.0                                ...           2 months ago
  • 1.4.0                                ...           2 months ago
  • 1.3.0                                ...           2 months ago
  • 1.2.1                                ...           2 months ago
  • 1.2.0                                ...           2 months ago
  • 1.1.2                                ...           2 months ago
  • 1.1.1                                ...           2 months ago
  • 1.1.0                                ...           2 months ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           3 months ago
  • 1.0.0                                ...           3 months ago
  • 0.3.0                                ...           3 months ago
  • 0.2.0                                ...           3 months ago
  • 0.1.6                                ...           3 months ago
  • 0.1.2                                ...           3 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
  • 0.1.0-0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 21
Last Day 0
Last Week 21
Last Month 1
Dependencies (79)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |