Skip to content

Commit

Permalink
Merge pull request #1334 from jbruni/patch-1
Browse files Browse the repository at this point in the history
Require Webpack config only when used
  • Loading branch information
junedkazi authored Aug 22, 2018
2 parents 9fb9ee8 + edbc598 commit f3434e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Require Webpack config only when used (reduce time to be ready for receiving messages from stencil-cli). [#1334](https://github.com/bigcommerce/cornerstone/pull/1334)

## 2.3.2 (2018-08-17)
- Fix zoom behavior for small images in gallery (turn off zoom if image is too small). [#1325](https://github.com/bigcommerce/cornerstone/pull/1325)
Expand Down
6 changes: 4 additions & 2 deletions stencil.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
var webpack = require('webpack');
var devConfig = require('./webpack.dev.js');
var prodConfig = require('./webpack.prod.js');

/**
* Watch options for the core watcher
Expand All @@ -26,6 +24,8 @@ var watchOptions = {
* Watch any custom files and trigger a rebuild
*/
function development() {
var devConfig = require('./webpack.dev.js');

// Rebuild the bundle once at bootup
webpack(devConfig).watch({}, err => {
if (err) {
Expand All @@ -40,6 +40,8 @@ function development() {
* Hook into the `stencil bundle` command and build your files before they are packaged as a .zip
*/
function production() {
var prodConfig = require('./webpack.prod.js');

webpack(prodConfig).run(err => {
if (err) {
console.error(err.message, err.details);
Expand Down

0 comments on commit f3434e5

Please sign in to comment.