0.1.1 • Published 6 years ago

@le-phare/webpack-config v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

@le-phare/webpack-config

Installation

npm install --save-dev webpack webpack-config @le-phare/webpack-config

Usage

Add scripts to your package.json:

{
  "scripts": {
    "build": "NODE_ENV=production webpack -p",
    "build:dev": "webpack",
    "build:watch": "webpack --watch"
  }
}

Create a webpack.config.js:

import Config from 'webpack-config';

export default new Config().extend(
  '@le-phare/webpack-config'
).merge({
  entry: {
    app: [
      'babel-polyfill',
      'src/SiteBundle/Resources/assets/app.js'
    ]
  }
});

Configuration

ConfigurationEnvironmentDefault valueDescription
outputPathOUTPUT_PATHweb/compiledWhere compiled assets will be compiled

You can update configuration by modifying your webpack.config.js like this:

import Config, { environment } from 'webpack-config';

environment.setAll({
  outputPath: () => process.env.OUTPUT_PATH || 'public/assets'
});

export default new Config().extend(
  'conf/webpack.[env].config.js'
).merge({
  // ... your extended config goes here
});