Skip to content

Commit

Permalink
Don't serve during builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Nov 5, 2019
1 parent 095def3 commit 067e877
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"typescript": "^3.6.4"
},
"scripts": {
"start": "rollup -c --watch",
"start": "rollup -c rollup.config.dev.js --watch",
"build": "npm run lint && npm run rollup",
"lint": "eslint src/*.ts",
"rollup": "rollup -c"
Expand Down
30 changes: 30 additions & 0 deletions rollup.config.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import resolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import babel from 'rollup-plugin-babel';
import serve from 'rollup-plugin-serve';
import { terser } from 'rollup-plugin-terser';

export default {
input: ['src/boilerplate-card.ts'],
output: {
dir: './dist',
format: 'es',
},
plugins: [
resolve(),
typescript(),
babel({
exclude: 'node_modules/**',
}),
terser(),
serve({
contentBase: './dist',
host: '0.0.0.0',
port: 5000,
allowCrossOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
}),
],
};
10 changes: 0 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import resolve from "rollup-plugin-node-resolve";
import typescript from "rollup-plugin-typescript2";
import babel from "rollup-plugin-babel";
import serve from "rollup-plugin-serve";
import { terser } from "rollup-plugin-terser";

export default {
Expand All @@ -17,14 +16,5 @@ export default {
exclude: "node_modules/**"
}),
terser(),
serve({
contentBase: "./dist",
host: "0.0.0.0",
port: 5000,
allowCrossOrigin: true,
headers: {
"Access-Control-Allow-Origin": "*"
}
})
]
};

0 comments on commit 067e877

Please sign in to comment.