Skip to content

Commit

Permalink
Merge pull request #39 from SDFIdk/v1.1.0
Browse files Browse the repository at this point in the history
V1.1.0
  • Loading branch information
Gebuz committed May 23, 2023
2 parents 93d50c3 + 637339c commit 369a97b
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 294 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ GSearch-UI is configured using html data attributes.
|attribute name|description|required|updates dynamically|default|
|:---|---|---|---|---|
|`data-token`|A valid token from https://dataforsyningen.dk/|yes|yes|`NaN`|
|`data-resources`|The resources that should be searched in. See more information in the [GSearch documentation](https://github.com/SDFIdk/gsearch/tree/main/doc)|no|yes|`navngivenvej,husnummer,adresse,stednavn,kommune,region,retskreds,postnummer,opstillingskreds,sogn,politikreds,matrikel`|
|`data-resources`|The resources that should be searched in. See more information in the [GSearch documentation](https://github.com/SDFIdk/gsearch/tree/main/doc)|no|yes|`navngivenvej,husnummer,adresse,stednavn,kommune,region,retskreds,postnummer,opstillingskreds,sogn,politikreds,matrikel,matrikel_udgaaet`|
|`data-limit`|The number of matches for each resource to be shown. The maximum value is 100.|no|yes|`10`|
|`data-placeholder`|The placeholder text to show in the input field.|no|yes|`søg...`|
|`data-api`|Use a custom URL for GSearch API (ie. if you want to use a test API)|no|yes|`https://api.dataforsyningen.dk/rest/gsearch/v1.0/`|
Expand Down
56 changes: 30 additions & 26 deletions esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,47 @@ const entry_points = {
}


if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV === 'production') {

// Development mode watches for file changes and rebuilds
esbuild.serve({
servedir: 'public',
}, {
// Production build
esbuild.build({
entryPoints: entry_points,
loader: {
'.ttf': 'file'
},
outdir: 'public',
bundle: true,
format: 'esm'
}).then(server => {
console.log('Running development server')
console.log(server)
// Call "stop" on the web server to stop serving
//server.stop()
minify: true,
metafile: true,
splitting: true,
format: 'esm',
loader: {
'.ttf': 'file'
}
})
.then((result) => {

esbuild.analyzeMetafile(result.metafile).then((analysis) => {
console.log(analysis)
console.log('Build finished 👍')
})

})
.catch(() => process.exit(1))

} else {

// Production build
esbuild.build({
// Development mode watches for file changes and rebuilds
esbuild.context({
entryPoints: entry_points,
outdir: 'public',
bundle: true,
loader: {
'.ttf': 'file'
},
outdir: 'public',
bundle: true,
format: 'esm',
minify: true,
sourcemap: true
splitting: true,
format: 'esm'
})
.then((response) => {
console.log('Build finished 👍')
.then((result) => {
let { host, port } = result.serve({
servedir: 'public',
})
})
.catch(() => process.exit(1))


}
Loading

0 comments on commit 369a97b

Please sign in to comment.