1.3.0 • Published 4 years ago

aurgil-webpack-setup v1.3.0

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

aurgil-webpack-setup

This package allows you to get webpack config without to re-write it your-self.

This package contains three configurations for webpack

  • Production : This configuration allows you to generate a build version of your webpack application
  • Development : This configuration contains necessary tools to develop with webpack (source-map, server)
  • Analysis : This configuration allows you to get a page to analyze your webpack application size (by chunk)

How to install

  • Go to you project repository
cd my-project
  • Use Node.js to setup npm then install 'aurgil-webpack-setup'
npm init -y
npm i -D aurgil-webpack-setup

How to use

  • In your webpack config file (webpack.config.js), first of all, you have to get 'aurgil-webpack-setup'. Add the next line at the beginning of the file.
const WebpackSetup = require("aurgil-webpack-setup").WebpackSetup;
  • You have to require the webpack-merge package to make your life easier. Add the next line after the previous.
const webpackMerge = require("webpack-merge");
  • Now, you can write your webpack config and merge it with default configuration of 'aurgil-webpack-setup'.
let webpackSetup      = new WebpackSetup(__dirname);
let myWebpackConfig   = {entry: "./src/index.js"};

let devWebpackConfig  = webpackMerge(myWebpackConfig, webpackSetup.development.config());
let prodWebpackConfig = webpackMerge(myWebpackConfig, webpackSetup.production.config() );
let anlWebpackConfig  = webpackMerge(myWebpackConfig, webpackSetup.analysis.config()   );

module.exports = devWebpackConfig ;
//module.exports = prodWebpackConfig;
//module.exports = anlWebpackConfig ;
  • Finaly, you can start webpack with the configuration
webpack --config webpack.config.js

Default configuration

  • Production configuration :
~=productionConfig=~
  • Development configuration :
~=developmentConfig=~
  • Analysis configuration :
~=analysisConfig=~
1.3.0

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.9

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.11

4 years ago

1.0.10

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.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago