Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Webpack config only when used #1334

Merged
merged 1 commit into from
Aug 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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