Skip to content

Commit

Permalink
don't serve in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
berndartmueller committed Aug 23, 2020
1 parent 58c5633 commit ca0a4f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
![size][size-shield]
[![Build Status](https://travis-ci.org/berndartmueller/virchual.svg?branch=master)](https://travis-ci.org/berndartmueller/virchual)

<!-- PROJECT LOGO -->
<br />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"test": "NODE_ENV=test jest --bail",
"build": "rollup -c && tsc",
"build:prod": "NODE_ENV=production rollup -c && tsc",
"dev": "rollup -cw && tsc",
"dev": "NODE_ENV=development rollup -cw && tsc",
"publish-docs": "cd website && GIT_USER=berndartmueller CURRENT_BRANCH=master npm run publish-gh-pages"
},
"repository": {
Expand Down
29 changes: 16 additions & 13 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import postcss_copy from 'postcss-copy';
import visualizer from 'rollup-plugin-visualizer';
import bundleSize from 'rollup-plugin-bundle-size';

const isDevelopment = process.env.NODE_ENV === 'development';

export default {
input: 'src/virchual.ts', // our source file
output: [
Expand Down Expand Up @@ -57,22 +59,23 @@ export default {
sourceMap: true,
//minimize: true, // Causes an error at the moment for some reason
}),
serve({
open: true,
isDevelopment &&
serve({
open: true,

host: '0.0.0.0',
host: '0.0.0.0',

// Page to navigate to when opening the browser.
// Will not do anything if open=false.
// Remember to start with a slash.
openPage: '/index.html',
// Page to navigate to when opening the browser.
// Will not do anything if open=false.
// Remember to start with a slash.
openPage: '/index.html',

// Multiple folders to serve from
contentBase: ['dist', 'examples'],
// Multiple folders to serve from
contentBase: ['dist', 'examples'],

// Options used in setting up server
host: 'localhost',
port: 1337,
}),
// Options used in setting up server
host: 'localhost',
port: 1337,
}),
],
};

0 comments on commit ca0a4f4

Please sign in to comment.