Skip to content

Commit 30db17f

Browse files
brandovleeBrandon Lee
and
Brandon Lee
authored
Migrate Vue-CLI to Vite (#344)
* Update to latest version of Vue2 (2.7). * Uninstall Vue-CLI and related dependencies. Update eslint. * Updated scripts (will need to update test:unit and test as vite does not have a testing framework out of the box like Vue-CLI). * Update environmental variables. * Added vite.config.js. * Uninstall @vue/test-unit and jest-vue-preprocessor. * Added .vue to SFC imports. * Changed proccess.env to import.meta.env. Fixed importing issues. * Added vite-plugin-vue2-svg to support svg imports (Will need to upgrade when migrating to Vue3). * Resolved errors for using / for division outside of calc. (SASS deprecated). * Moved SVGs to src/icon folder. Switched from .js to .mjs for ESM. * Removed unnecessary dependencies. * Fixed to run on localhost 3000. * Updated path to icons for campaign reduction tips. * Modified index.js to allow for building comparison. --------- Co-authored-by: Brandon Lee <[email protected]>
1 parent 12ec274 commit 30db17f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+16401
-30567
lines changed

.env.development

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VUE_APP_ROOT_API=http://localhost:3000
2-
VUE_APP_HOST_ADDRESS=http://localhost:8080
1+
VITE_ROOT_API=http://localhost:3000
2+
VITE_HOST_ADDRESS=http://localhost:8080

.env.production

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NODE_ENV=production
2-
VUE_APP_ROOT_API=https://api.sustainability.oregonstate.edu/v2/energy
3-
VUE_APP_HOST_ADDRESS=https://dashboard.sustainability.oregonstate.edu
2+
VITE_ROOT_API=https://api.sustainability.oregonstate.edu/v2/energy
3+
VITE_HOST_ADDRESS=https://dashboard.sustainability.oregonstate.edu

.env.staging

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NODE_ENV=production
2-
VUE_APP_ROOT_API=https://api.sustainability.oregonstate.edu/v2/energy
3-
VUE_APP_HOST_ADDRESS=http://energy-dashboard.s3-website-us-west-2.amazonaws.com
2+
VITE_ROOT_API=https://api.sustainability.oregonstate.edu/v2/energy
3+
VITE_HOST_ADDRESS=http://energy-dashboard.s3-website-us-west-2.amazonaws.com

.eslintrc.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
module.exports = {
99
root: true,
1010
parserOptions: {
11-
parser: 'babel-eslint'
11+
ecmaVersion: 'latest',
12+
sourceType: 'module'
1213
},
1314
env: {
14-
browser: true
15+
browser: true,
16+
es2022: true
1517
},
1618
extends: [
1719
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
@@ -25,6 +27,7 @@ module.exports = {
2527
// add your custom rules here
2628
rules: {
2729
// allow async-await
30+
'vue/multi-word-component-names': 'off',
2831
'no-multi-spaces': 'off',
2932
'generator-star-spacing': 'off',
3033
camelcase: [0, { properties: 'never' }],

babel.config.js

-24
This file was deleted.

public/index.html renamed to index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
<body>
7676
<div id="app"></div>
77-
<!-- built files will be auto injected -->
77+
<script type="module" src="/src/main.js"></script>
7878
</body>
7979
<script>
8080
if (!supportsES6) {

0 commit comments

Comments
 (0)