Skip to content

Commit

Permalink
Reworked placement of env setup according to feedback in storybookjs#…
Browse files Browse the repository at this point in the history
  • Loading branch information
swernerx committed Jul 2, 2018
1 parent 69d4843 commit b4547fd
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 56 deletions.
1 change: 1 addition & 0 deletions app/angular/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/angular/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);
1 change: 1 addition & 0 deletions app/html/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/html/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);
1 change: 1 addition & 0 deletions app/marko/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/marko/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);
1 change: 1 addition & 0 deletions app/mithril/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/mithril/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);
1 change: 1 addition & 0 deletions app/polymer/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/polymer/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);
1 change: 1 addition & 0 deletions app/react/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/react/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);
1 change: 1 addition & 0 deletions app/vue/bin/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node

process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('../dist/server/build');
11 changes: 3 additions & 8 deletions app/vue/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Building for distribution defaults to production target.
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
import { buildStatic } from '@storybook/core/server';
import options from './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);
buildStatic(options);

0 comments on commit b4547fd

Please sign in to comment.