-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Alviner/feature/esm
feat: esm init
- Loading branch information
Showing
20 changed files
with
294 additions
and
322 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
"project_description": "Vue Admin Panel", | ||
"_copy_without_render": [ | ||
"*.vue", | ||
"*.css", | ||
"*.js" | ||
"*.css" | ||
] | ||
} |
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,6 @@ | ||
/**/vendor.* | ||
/**/es-module-shims.* | ||
env/ | ||
!vendor.js | ||
buildVendor.js | ||
|
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,23 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: [ | ||
'plugin:vue/vue3-recommended', | ||
'eslint:recommended' | ||
], | ||
overrides: [ | ||
{ | ||
files: ['*.js', '*.vue'], | ||
}, | ||
], | ||
rules: { | ||
'vue/multi-word-component-names': ['error', { ignores: ['Home'] }], | ||
'vue/html-self-closing': ['error', { | ||
'html': { | ||
'void': 'never', | ||
'normal': 'never', | ||
'component': 'never', | ||
} | ||
|
||
}] | ||
} | ||
}; |
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,60 @@ | ||
const gzipPlugin = require('@luncheon/esbuild-plugin-gzip'); | ||
const esbuild = require('esbuild'); | ||
|
||
const modulePath = process.env.NODE_PATH || 'node_modules'; | ||
const nodePaths = [modulePath]; | ||
|
||
process.env.NODE_ENV = 'production'; | ||
|
||
const target = [ | ||
'es2020', 'chrome58', 'firefox57', 'safari11', | ||
]; | ||
const outdir = './{{cookiecutter.project_slug}}/admin/static/vendor'; | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: [ | ||
'./vendor/vendor.js', | ||
], | ||
bundle: true, | ||
minify: true, | ||
sourcemap: true, | ||
plugins: [gzipPlugin({ | ||
uncompressed: false, | ||
gzip: true, | ||
brotli: false, | ||
})], | ||
loader: { | ||
'.png': 'base64', | ||
'.svg': 'base64', | ||
'.woff': 'dataurl', | ||
'.woff2': 'dataurl', | ||
'.eot': 'dataurl', | ||
'.ttf': 'dataurl', | ||
}, | ||
format: 'esm', | ||
write: false, | ||
outdir, | ||
target, | ||
nodePaths, | ||
}); | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: [ | ||
'es-module-shims', | ||
], | ||
bundle: true, | ||
minify: true, | ||
sourcemap: true, | ||
format: 'iife', | ||
plugins: [gzipPlugin({ | ||
uncompressed: false, | ||
gzip: true, | ||
brotli: false, | ||
})], | ||
outdir, | ||
write: false, | ||
target, | ||
nodePaths, | ||
}); |
Binary file not shown.
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,33 @@ | ||
{ | ||
"license": "unlicence", | ||
"private": true, | ||
"scripts": { | ||
"build": "node buildVendor.js", | ||
"lint": "eslint .", | ||
"lint-fix": "eslint . --fix" | ||
}, | ||
"dependencies": { | ||
"@element-plus/icons-vue": "^2.0.10", | ||
"@wsrpc/client": "4.4.1", | ||
"element-plus": "^2.2.32", | ||
"es-module-shims": "1.7.0", | ||
"esbuild": "0.17.10", | ||
"vue": "3.2.47", | ||
"vue-router": "4.1.6" | ||
}, | ||
"devDependencies": { | ||
"@luncheon/esbuild-plugin-gzip": "^0.1.0", | ||
"eslint": "^8.34.0", | ||
"eslint-plugin-vue": "^9.9.0" | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"not IE 11", | ||
"not op_mini all", | ||
"not samsung 12", | ||
"not and_uc 12", | ||
"not ios_saf 12.2", | ||
"not ios_saf 13.4" | ||
], | ||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" | ||
} |
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,37 @@ | ||
|
||
import 'element-plus/dist/index.css'; | ||
import WSRPC from '@wsrpc/client'; | ||
|
||
import { | ||
createApp, | ||
} from 'vue/dist/vue.esm-bundler.js'; | ||
|
||
import { | ||
createRouter, | ||
createWebHistory, | ||
RouterLink, | ||
} from 'vue-router/dist/vue-router.esm-bundler.js'; | ||
|
||
import elementPlusLocale from 'element-plus/es/locale/lang/ru.mjs'; | ||
import elementPlus, { | ||
ElLoading as Loading, | ||
ElMessage as Message, | ||
ElNotification as Notification, | ||
} from 'element-plus'; | ||
|
||
|
||
export { | ||
WSRPC, | ||
|
||
createApp, | ||
|
||
createWebHistory, | ||
createRouter, | ||
RouterLink, | ||
|
||
elementPlus, | ||
elementPlusLocale, | ||
Loading, | ||
Message, | ||
Notification, | ||
}; |
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/admin/static/App.js
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,4 @@ | ||
export default { | ||
template: '<router-view/>', | ||
}; | ||
|
Oops, something went wrong.