/webpack-mixer

Primary LanguageTypeScriptMIT LicenseMIT

Webpack Mixer

Built on top of laravel-mix.

Install

yarn add webpack --dev "SwagDevOps/webpack-mixer#develop"

Configure

Sample webpack.mix.js file:

const { Mixer } = require('@swagdevops/webpack-mixer')

const mixer = new Mixer()
const paths = mixer.paths

// Configuration ----------------------------------------------------
const copiables = [
  [paths.source.join('images/favicon.png'), paths.public.join('favicon.ico')],
  [paths.source.join('images'), paths.public.join('images')]
]

const cleanables = [
  paths.public.join('css/app.css.map'),
  paths.public.join('js/app.js.map')
]

// Execution --------------------------------------------------------
mixer.configure({
  copiables: copiables,
  cleanables: cleanables,
  webpack: {
    node: {
      fs: 'empty'
    }
  }
}).run()

Run

node_modules/webpack/bin/webpack.js \
    --progress --hide-modules \
    --config node_modules/@swagdevops/webpack-mixer/setup/webpack.config.js
node_modules/webpack/bin/webpack.js \
    --progress --hide-modules \
    --watch \
    --config node_modules/@swagdevops/webpack-mixer/setup/webpack.config.js