diff --git a/.env b/.env new file mode 100644 index 0000000..da444d6 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +# 所有环境默认 \ No newline at end of file diff --git a/dependencies-cdn.js b/dependencies-cdn.js new file mode 100644 index 0000000..33adfff --- /dev/null +++ b/dependencies-cdn.js @@ -0,0 +1,13 @@ +module.exports = [ + { name: 'vue', library: 'Vue', js: 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', css: '' }, + { name: 'axios', library: 'axios', js: 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', css: '' }, + { name: 'brace', library: 'ace', js: 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', css: '' }, + { name: 'brace/ext/language_tools', library: 'language_tools', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/ext/language_tools.js', css: '' }, + { name: 'brace/mode/html', library: 'html', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/html.js', css: '' }, + { name: 'brace/mode/javascript', library: 'javascript', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/javascript.js', css: '' }, + { name: 'brace/mode/less', library: 'less', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/less.js', css: '' }, + { name: 'brace/theme/chrome', library: 'chrome', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/theme/chrome.js', css: '' }, + { name: 'brace/snippets/javascript', library: 'javascript', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/snippets/javascript.js', css: '' }, + // { name: 'vue2-ace-editor', library: 'Vue2ACEEditor', js: 'https://cdn.jsdelivr.net/npm/vue2-ace-editor@0.0.15/index.min.js', css: '' }, + { name: 'markdown-it', library: 'markdownit', js: 'https://cdn.jsdelivr.net/npm/markdown-it@10.0.0/dist/markdown-it.min.js', css: '' }, +] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e4b52ed..a86d610 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4253,7 +4253,7 @@ }, "ejs": { "version": "2.7.4", - "resolved": "https://registry.npm.taobao.org/ejs/download/ejs-2.7.4.tgz?cache=0&sync_timestamp=1585506989655&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fejs%2Fdownload%2Fejs-2.7.4.tgz", + "resolved": "https://registry.npm.taobao.org/ejs/download/ejs-2.7.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fejs%2Fdownload%2Fejs-2.7.4.tgz", "integrity": "sha1-SGYSh1c9zFPjZsehrlLDoSDuybo=", "dev": true }, @@ -11934,7 +11934,7 @@ }, "webpack-bundle-analyzer": { "version": "3.7.0", - "resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.7.0.tgz?cache=0&sync_timestamp=1586846510646&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.7.0.tgz", + "resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.7.0.tgz?cache=0&sync_timestamp=1586846559504&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.7.0.tgz", "integrity": "sha1-hNpDTolEKJm4hNmtOORm0NsCpW8=", "dev": true, "requires": { diff --git a/package.json b/package.json index 6b7f213..a76ad2e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "analyz": "npm_config_report=true npm run build" }, "dependencies": { "axios": "^0.19.2", @@ -25,7 +26,8 @@ "babel-eslint": "^10.1.0", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", - "vue-template-compiler": "^2.6.11" + "vue-template-compiler": "^2.6.11", + "webpack-bundle-analyzer": "^3.7.0" }, "eslintConfig": { "root": true, diff --git a/public/app.js b/public/app.js new file mode 100644 index 0000000..febfb57 --- /dev/null +++ b/public/app.js @@ -0,0 +1,26 @@ +var styles = [ + 'https://cloud.jsonpop.cn/go2index/dist/test/app.069f50e0.css' +] +var scripts = [ + 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', + 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', + 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/ext/language_tools.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/html.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/javascript.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/less.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/theme/chrome.js', + 'https://cdn.jsdelivr.net/npm/brace@0.11.1/snippets/javascript.js', + 'https://cdn.jsdelivr.net/npm/vue2-ace-editor@0.0.15/index.min.js', + 'https://cdn.jsdelivr.net/npm/markdown-it@10.0.0/dist/markdown-it.min.js', + 'https://cloud.jsonpop.cn/go2index/dist/test/chunk-vendors.3ecd550f.js', + 'https://cloud.jsonpop.cn/go2index/dist/test/app.066f1c02.js' +] + +styles.forEach(item => { + document.write(``); +}) +scripts.forEach(item => { + document.write(``); +}) \ No newline at end of file diff --git a/public/index.html b/public/index.html index e406d1e..3614ece 100644 --- a/public/index.html +++ b/public/index.html @@ -5,6 +5,15 @@ + + <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %> + + + <% } %> + + <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> + + <% } %>