diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index f0c67eba9d..7d3b0db10a 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -8,11 +8,23 @@ You must have a local copy of this repository somewhere on your machine. From th Once that is done, you will run: +**Unix/MacOS:** + +```shell +~/primereact/ $ npm run dev:link +``` + +**Windows:** +dev:link:windows + ```shell -~/primereact/ $ npm run build:lib:dev +C:\primereact> npm run dev:link:windows ``` -This will alter the bundler to only emit non-minified esm modules. The aliasing plugin has also been disabled for components. Once everything has been bundled (this can take a few minutes) you should keep this command running. It will allow for incremental builds as you develop in the `primereact/` directory. It will be finished when the terminal displays: `[20xx-xx-xx 00:00:00] waiting for changes...`. +This will alter the bundler to only emit non-minified esm modules. The aliasing plugin has also been disabled for components. Once everything has been bundled (this can take a few minutes) you should keep this command running. It will allow for incremental builds as you develop in the `primereact/` directory. + +> **Note** +> It will be finished when the terminal displays: `[20xx-xx-xx 00:00:00] waiting for changes...`. You will now `cd` into the `primereact/dist` directory and run: @@ -29,7 +41,8 @@ This will create a symlink in your global npm scope so that other local packages └── primereact@XX.X.XX -> ./../../../Users/${user}/primereact/dist # <-- this must be in the dist/ dir !!! ``` -**Reminder! the XX.X.XX version must be a valid [valid semantic version](https://docs.npmjs.com/about-semantic-versioning) that you are using in your local project** +> **Warning** +> Reminder! the XX.X.XX version must be a valid [valid semantic version](https://docs.npmjs.com/about-semantic-versioning) that you are using in your local project ### Now change your directory to your local project you are developing on! diff --git a/package.json b/package.json index 814c47cc00..6ee756b42d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build": "next build", "build:lib": "NODE_ENV=production INPUT_DIR=components/lib/ OUTPUT_DIR=dist/ npm run build:package", "build:package": "npm run build:check && rollup -c && gulp build-resources && npm run build:api", - "build:lib:dev": "NPM_LINK=true NODE_ENV=production INPUT_DIR=components/lib/ OUTPUT_DIR=dist/ npm run build:package:dev", + "dev:link": "NPM_LINK=true NODE_ENV=production INPUT_DIR=components/lib/ OUTPUT_DIR=dist/ npm run build:package:dev", + "dev:link:windows": "set NPM_LINK=true && set NODE_ENV=production&& set INPUT_DIR=components/lib/&& set OUTPUT_DIR=dist/&& npm run build:package:dev", "build:package:dev": "npm run build:check && rollup -c --watch && gulp build-resources && npm run build:api", "build:api": "npm run apiwebtypes && npm run apidoc", "build:check": "npm run lint && npm run format:check && npm run type:check && npm run security:check && (NODE_ENV=test npm run test:check)", diff --git a/rollup.config.js b/rollup.config.js index 20af6ab55f..49e6234469 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -223,6 +223,7 @@ function addEntry(name, input, output, isComponent = true) { }; entries.push(get_CJS_ESM()); + if (!NPM_LINK) { entries.push(get_IIFE());