-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: make node url dynamic * feat: make component url dynamic * fix: revert vite version * feat: added start:dev command
- Loading branch information
Arne Vandoorslaer
authored
Jul 7, 2021
1 parent
79626f1
commit 486aff6
Showing
13 changed files
with
157 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_SEMCOM_NODE_URI=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_SEMCOM_NODE_URI=https://node.semcom.digita.ai |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,43 @@ | ||
import { defineConfig } from 'vite'; | ||
import { defineConfig, loadEnv } from 'vite'; | ||
|
||
export default defineConfig({ | ||
root: 'src', | ||
build: { | ||
target: 'es2015', | ||
outDir: '../dist', | ||
}, | ||
server: { | ||
port: 4200, | ||
export default defineConfig( ({ command, mode }) => { | ||
const env = loadEnv(mode, process.cwd()); | ||
|
||
// expose .env as process.env instead of import.meta since jest does not import meta yet | ||
const envWithProcessPrefix = Object.entries(env).reduce( | ||
(prev, [key, val]) => { | ||
return { | ||
...prev, | ||
['process.env.' + key]: `"${val}"`, | ||
['process.env.DEV']: `"${command === 'serve'}"`, | ||
['process.env.PROD']: `"${command === 'build'}"`, | ||
['process.env.MODE']: command === 'build' ? `"PROD"` : `"DEV"`, | ||
} | ||
}, | ||
{}, | ||
); | ||
|
||
if (command === 'serve') { | ||
return { | ||
root: 'src', | ||
server: { | ||
port: 4200, | ||
}, | ||
mode: 'development', | ||
define: envWithProcessPrefix, | ||
} | ||
} else if (command === 'build'){ | ||
return { | ||
root: 'src', | ||
build: { | ||
target: 'es2015', | ||
outDir: '../dist', | ||
}, | ||
server: { | ||
port: 4200, | ||
}, | ||
mode: 'production', | ||
define: envWithProcessPrefix, | ||
} | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"@context": [ | ||
"https://linkedsoftwaredependencies.org/bundles/npm/@digita-ai/semcom-node/^0.0.0/components/context.jsonld", | ||
"https://linkedsoftwaredependencies.org/bundles/npm/@digita-ai/semcom-core/^0.0.0/components/context.jsonld" | ||
], | ||
"import": [ | ||
"files-dasn:config/presets/logger.json", | ||
"files-dasn:config/presets/serializer.json", | ||
"files-dasn:config/presets/component.json", | ||
"files-dasn:config/presets/handlers.json", | ||
"files-dasn:config/presets/server.json" | ||
], | ||
"@graph": [ | ||
{ | ||
"@id": "urn:semcom-node:default:ComponentStore", | ||
"@type": "ComponentInMemoryStore", | ||
"ComponentInMemoryStore:_components": [ | ||
{ | ||
"@type": "ComponentMetadata", | ||
"ComponentMetadata:_description": "Digita SemCom component for profile information.", | ||
"ComponentMetadata:_label": "SemCom Profile Component", | ||
"ComponentMetadata:_uri": "http://localhost:8080/components/profile.component.js", | ||
"ComponentMetadata:_shapes": "http://xmlns.com/foaf/0.1/PersonalProfileDocument", | ||
"ComponentMetadata:_author": "https://digita.ai", | ||
"ComponentMetadata:_tag": "profile", | ||
"ComponentMetadata:_version": "0.1.0", | ||
"ComponentMetadata:_latest": true | ||
}, | ||
{ | ||
"@type": "ComponentMetadata", | ||
"ComponentMetadata:_description": "Digita SemCom component with an input field.", | ||
"ComponentMetadata:_label": "SemCom Input Component", | ||
"ComponentMetadata:_uri": "http://localhost:8080/components/input.component.js", | ||
"ComponentMetadata:_shapes": "http://digita.ai/voc/input#input", | ||
"ComponentMetadata:_author": "https://digita.ai", | ||
"ComponentMetadata:_tag": "input", | ||
"ComponentMetadata:_version": "0.1.0", | ||
"ComponentMetadata:_latest": true | ||
}, | ||
{ | ||
"@type": "ComponentMetadata", | ||
"ComponentMetadata:_description": "Digita SemCom component for payslip information.", | ||
"ComponentMetadata:_label": "SemCom Payslip Component", | ||
"ComponentMetadata:_uri": "http://localhost:8080/components/payslip.component.js", | ||
"ComponentMetadata:_shapes": "http://digita.ai/voc/payslip#payslip", | ||
"ComponentMetadata:_author": "https://digita.ai", | ||
"ComponentMetadata:_tag": "payslip", | ||
"ComponentMetadata:_version": "0.1.0", | ||
"ComponentMetadata:_latest": true | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters