Skip to content

Commit

Permalink
Merge pull request #1126 from Angra974/vite-as-index_html-loader
Browse files Browse the repository at this point in the history
Added vitejs as a launcher for index.html. package.json
  • Loading branch information
pcottle authored Feb 7, 2024
2 parents 40ddfca + ff6754e commit de070be
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# NPM and Yarn
# NPM / Yarn / Pnpm
npm-debug.log
yarn-error.log
pnpm-lock.yaml
node_modules/

# Build artifacts and asset stuff
Expand Down Expand Up @@ -50,4 +51,4 @@ DerivedData
VendorLib/clang/lib/arc
VendorLib/clang/lib/c++

.idea
.idea
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"author": "Peter Cottle <[email protected]>",
"license": "MIT",
"scripts": {
"dev": "vite",
"prepare": "gulp fastBuild",
"test": "gulp test"
},
"repository": {
Expand Down Expand Up @@ -33,7 +35,8 @@
"jshint": "^2.13.4",
"prompt": "^1.2.2",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
"vinyl-source-stream": "^2.0.0",
"vite": "^4.0.12"
},
"dependencies": {
"backbone": "^1.4.0",
Expand Down
3 changes: 1 addition & 2 deletions src/template.index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
Expand Down
16 changes: 16 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from 'vite';

export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
if (command === 'serve') {
return {
// dev specific config
}
} else {
// command === 'build'
return {
// build specific config
}
}
})


0 comments on commit de070be

Please sign in to comment.