Skip to content

Commit

Permalink
osrd-ui: enable hot reload only when we are in development
Browse files Browse the repository at this point in the history
kmer2016 committed Apr 5, 2024

Verified

This commit was signed with the committer’s verified signature.
kyteinsky Anupam Kumar
1 parent 8ebc593 commit 1e83fd4
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Check Code
name: Build osrd-ui

on: [push]

2 changes: 1 addition & 1 deletion ui-core/package.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
"rollup": "rollup -c",
"clean": "rimraf dist",
"build": "npm run rollup",
"watch": "rollup -c -w"
"watch": "NODE_ENV=development rollup -c -w"
},
"peerDependencies": {
"react": ">=18.0"
9 changes: 6 additions & 3 deletions ui-core/rollup.config.js
Original file line number Diff line number Diff line change
@@ -3,8 +3,10 @@ import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import livereload from 'rollup-plugin-livereload';
import postcss from 'rollup-plugin-postcss';
import process from 'process';

const formats = ['esm'];
const isDev = process.env.NODE_ENV === 'development';

/** @type {import("rollup").RollupOptions} */
export default {
@@ -24,9 +26,10 @@ export default {
plugins: [],
}),
terser(),
// livereload({
// watch: 'dist',
// }),
isDev &&
livereload({
watch: 'dist',
}),
],
external: ['react'],
};

0 comments on commit 1e83fd4

Please sign in to comment.