-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked build scripts to implement default=production in a way that …
…it works better with load-time side-effects.
- Loading branch information
Showing
7 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { buildStatic } from '@storybook/core/server'; | ||
// Building for distribution defaults to production target. | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
import options from './options'; | ||
|
||
buildStatic(options); | ||
// Note: We are importing via CommonJS to be able to adjust NODE_ENV | ||
// to production first before proceeding. This is required to correctly | ||
// e.g. selecting the `.env` files to import. It also helps with all ESM | ||
// imports which as some side-effect decide on things at "loadtime". | ||
const server = require('@storybook/core/server'); | ||
server.buildStatic(require('./options').default); |