Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Added extract-text and tweaked webpack config creation #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smashingpat
Copy link
Member

@smashingpat smashingpat commented Jul 7, 2017

I have added some tweaks to the webpack config creation so it becomes a bit more consistent and extendable.

  • instead of webpackConfig it becomes createWebpackConfig to create one
  • createConfig parameter minify changed to options and it expects an object with options (including minify). The boolean method still works but added a deprecation message for later versions.
  • added extract-text-webpack-plugin so the css will be written in its own css file, can be disabled in the createConfig by settings the option cssInjection to true (see example below on implementation)
  • entry and output parameters must be relative paths, added an assert with a throw Error
const { createConfig, createCompiler, createBuildTask } = require('meister-gulp-webpack-tasks');

const webpackConfig = createConfig('./example/main.js', './dist/hello.js', {
    minify: true,
    cssInjection: true,
});

const startBuild = createBuildTask(createCompiler(webpackConfig));

startBuild();

@ivo-toby ivo-toby removed their request for review July 7, 2017 13:44

const createWebpackConfig = (entry, outputPath, opts = initialOptions) => {
const options = merge({}, initialOptions, opts);
console.log(options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants