Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Webpack rules!

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Webpack rules!

Avatar for Henrique Sosa

Henrique Sosa

July 26, 2016
Tweet

More Decks by Henrique Sosa

Other Decks in Technology

Transcript

  1. module.exports = { context: path.join(__dirname, "./src"), entry: {}, output: {},

    module: { preLoaders: [], loaders: [], posLoaders: [] }, plugins: [], / * something else… */ }
  2. entry: { html: "./index.html", jsx: "./index.jsx", vendor: ["react"] }, output:

    { path: path.join(__dirname, "./dist"), filename: "bundle.js" }
  3. loaders: [ { test: /\.html$/, loader: "file?name=[name].[ext]" }, { test:

    /\.scss$/, loaders: ["style", "css", "sass"] } ]
  4. Plugins - CommonsChunkPlugin - HotModuleReplamentPlugin - DefinePlugin - openBrowserPlugin -

    devServer - IgnorePlugin - BannerPlugin - UglifyPlugin - OfflinePlugin - CleanPlugin - Extract CSS
  5. scripts: { "start": "webpack-dev-server --history-api-fallback --hot --inline --progress --colors --port

    3000", "dist": "webpack --verbose --colors --display-error-details --config webpack.config.prod.js" }