├── .babelrc ├── .gitignore ├── README.md ├── _config.yml ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── dist └── static │ ├── css │ └── app.bec4cd5a30128f7e5fffc5eceae9013e.css │ ├── fonts │ ├── feather.0b17bdf.eot │ ├── feather.34f9a3a.woff │ └── feather.ef0bf66.ttf │ ├── img │ └── feather.6335978.svg │ ├── js │ ├── app.38a024e9860e5b581ac6.js │ ├── manifest.2ae2e69a05c33dfc65f8.js │ └── vendor.821c21b50c9af3371e02.js │ ├── libs │ ├── download │ │ ├── Blob.js │ │ ├── FileSaver.js │ │ └── jszip.min.js │ └── webuploader │ │ ├── README.md │ │ ├── Uploader.swf │ │ ├── webuploader.css │ │ ├── webuploader.custom.js │ │ ├── webuploader.custom.min.js │ │ ├── webuploader.fis.js │ │ ├── webuploader.flashonly.js │ │ ├── webuploader.flashonly.min.js │ │ ├── webuploader.html5only.js │ │ ├── webuploader.html5only.min.js │ │ ├── webuploader.js │ │ ├── webuploader.min.js │ │ ├── webuploader.noimage.js │ │ ├── webuploader.noimage.min.js │ │ ├── webuploader.nolog.js │ │ ├── webuploader.nolog.min.js │ │ ├── webuploader.withoutimage.js │ │ └── webuploader.withoutimage.min.js │ └── tpl │ ├── js │ ├── body.js │ └── head.js │ ├── run1.html │ ├── run2.html │ ├── run3.html │ ├── run4.html │ ├── run5.html │ ├── run6.html │ ├── run7.html │ ├── run8.html │ ├── thematic.html │ └── zt │ └── base.css ├── index.html ├── libs ├── art-template │ └── template-web.js ├── dialogwindows │ ├── dialog-extends.js │ ├── dialog.js │ └── skins │ │ ├── facebook.css │ │ ├── icons │ │ ├── 32X32 │ │ │ ├── fail.png │ │ │ ├── hits.png │ │ │ ├── i.png │ │ │ └── succ.png │ │ ├── alert.gif │ │ ├── confirm.gif │ │ ├── discuz_bg.gif │ │ ├── error.gif │ │ ├── face-sad.png │ │ ├── face-smile.png │ │ ├── gb_tip_layer.png │ │ ├── gb_tip_layer_ie6.png │ │ ├── lhgcore.gif │ │ ├── loading.gif │ │ ├── prompt.gif │ │ ├── success.gif │ │ └── tips.gif │ │ ├── metro.css │ │ └── visualstudio.css ├── noty │ ├── jquery.noty.js │ ├── jquery.noty.min.js │ ├── noty.js │ ├── noty_demo.html │ └── themes │ │ ├── HzTheme.js │ │ ├── VsTheme.js │ │ ├── default.js │ │ └── vstheme2.js └── store │ └── store.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── src ├── App.vue ├── app.html ├── assets │ ├── css │ │ ├── common │ │ │ ├── common.css │ │ │ └── reset.css │ │ ├── fonts │ │ │ └── feather │ │ │ │ ├── css │ │ │ │ └── iconfont.css │ │ │ │ ├── feather.jpg │ │ │ │ ├── feather.sketch │ │ │ │ ├── fonts │ │ │ │ ├── feather.eot │ │ │ │ ├── feather.svg │ │ │ │ ├── feather.ttf │ │ │ │ └── feather.woff │ │ │ │ └── icons │ │ │ │ ├── activity.svg │ │ │ │ ├── airplay.svg │ │ │ │ ├── alert-circle.svg │ │ │ │ ├── alert-octagon.svg │ │ │ │ ├── alert-triangle.svg │ │ │ │ ├── align-center.svg │ │ │ │ ├── align-justify.svg │ │ │ │ ├── align-left.svg │ │ │ │ ├── align-right.svg │ │ │ │ ├── anchor.svg │ │ │ │ ├── aperture.svg │ │ │ │ ├── arrow-down-left.svg │ │ │ │ ├── arrow-down-right.svg │ │ │ │ ├── arrow-down.svg │ │ │ │ ├── arrow-left.svg │ │ │ │ ├── arrow-right.svg │ │ │ │ ├── arrow-up-left.svg │ │ │ │ ├── arrow-up-right.svg │ │ │ │ ├── arrow-up.svg │ │ │ │ ├── at-sign.svg │ │ │ │ ├── award.svg │ │ │ │ ├── bar-chart-2.svg │ │ │ │ ├── bar-chart.svg │ │ │ │ ├── battery-charging.svg │ │ │ │ ├── battery.svg │ │ │ │ ├── bell-off.svg │ │ │ │ ├── bell.svg │ │ │ │ ├── bluetooth.svg │ │ │ │ ├── bold.svg │ │ │ │ ├── book.svg │ │ │ │ ├── bookmark.svg │ │ │ │ ├── box.svg │ │ │ │ ├── briefcase.svg │ │ │ │ ├── calendar.svg │ │ │ │ ├── camera-off.svg │ │ │ │ ├── camera.svg │ │ │ │ ├── cast.svg │ │ │ │ ├── check-circle.svg │ │ │ │ ├── check-square.svg │ │ │ │ ├── check.svg │ │ │ │ ├── chevron-down.svg │ │ │ │ ├── chevron-left.svg │ │ │ │ ├── chevron-right.svg │ │ │ │ ├── chevron-up.svg │ │ │ │ ├── chevrons-down.svg │ │ │ │ ├── chevrons-left.svg │ │ │ │ ├── chevrons-right.svg │ │ │ │ ├── chevrons-up.svg │ │ │ │ ├── chrome.svg │ │ │ │ ├── circle.svg │ │ │ │ ├── clipboard.svg │ │ │ │ ├── clock.svg │ │ │ │ ├── cloud-drizzle.svg │ │ │ │ ├── cloud-lightning.svg │ │ │ │ ├── cloud-off.svg │ │ │ │ ├── cloud-rain.svg │ │ │ │ ├── cloud-snow.svg │ │ │ │ ├── cloud.svg │ │ │ │ ├── codepen.svg │ │ │ │ ├── command.svg │ │ │ │ ├── compass.svg │ │ │ │ ├── copy.svg │ │ │ │ ├── corner-down-left.svg │ │ │ │ ├── corner-down-right.svg │ │ │ │ ├── corner-left-down.svg │ │ │ │ ├── corner-left-up.svg │ │ │ │ ├── corner-right-down.svg │ │ │ │ ├── corner-right-up.svg │ │ │ │ ├── corner-up-left.svg │ │ │ │ ├── corner-up-right.svg │ │ │ │ ├── cpu.svg │ │ │ │ ├── credit-card.svg │ │ │ │ ├── crop.svg │ │ │ │ ├── crosshair.svg │ │ │ │ ├── delete.svg │ │ │ │ ├── disc.svg │ │ │ │ ├── download-cloud.svg │ │ │ │ ├── download.svg │ │ │ │ ├── droplet.svg │ │ │ │ ├── edit-2.svg │ │ │ │ ├── edit-3.svg │ │ │ │ ├── edit.svg │ │ │ │ ├── external-link.svg │ │ │ │ ├── eye-off.svg │ │ │ │ ├── eye.svg │ │ │ │ ├── facebook.svg │ │ │ │ ├── fast-forward.svg │ │ │ │ ├── feather.svg │ │ │ │ ├── file-minus.svg │ │ │ │ ├── file-plus.svg │ │ │ │ ├── file-text.svg │ │ │ │ ├── file.svg │ │ │ │ ├── film.svg │ │ │ │ ├── filter.svg │ │ │ │ ├── flag.svg │ │ │ │ ├── folder.svg │ │ │ │ ├── github.svg │ │ │ │ ├── gitlab.svg │ │ │ │ ├── globe.svg │ │ │ │ ├── grid.svg │ │ │ │ ├── hash.svg │ │ │ │ ├── headphones.svg │ │ │ │ ├── heart-on.svg │ │ │ │ ├── heart.svg │ │ │ │ ├── help-circle.svg │ │ │ │ ├── home.svg │ │ │ │ ├── image.svg │ │ │ │ ├── inbox.svg │ │ │ │ ├── info.svg │ │ │ │ ├── instagram.svg │ │ │ │ ├── italic.svg │ │ │ │ ├── layers.svg │ │ │ │ ├── layout.svg │ │ │ │ ├── life-buoy.svg │ │ │ │ ├── link-2.svg │ │ │ │ ├── link.svg │ │ │ │ ├── list.svg │ │ │ │ ├── loader.svg │ │ │ │ ├── lock.svg │ │ │ │ ├── log-in.svg │ │ │ │ ├── log-out.svg │ │ │ │ ├── mail.svg │ │ │ │ ├── map-pin.svg │ │ │ │ ├── map.svg │ │ │ │ ├── maximize-2.svg │ │ │ │ ├── maximize.svg │ │ │ │ ├── menu.svg │ │ │ │ ├── message-circle.svg │ │ │ │ ├── message-square.svg │ │ │ │ ├── mic-off.svg │ │ │ │ ├── mic.svg │ │ │ │ ├── minimize-2.svg │ │ │ │ ├── minimize.svg │ │ │ │ ├── minus-circle.svg │ │ │ │ ├── minus-square.svg │ │ │ │ ├── minus.svg │ │ │ │ ├── monitor.svg │ │ │ │ ├── moon.svg │ │ │ │ ├── more-horizontal.svg │ │ │ │ ├── more-vertical.svg │ │ │ │ ├── move.svg │ │ │ │ ├── music.svg │ │ │ │ ├── navigation-2.svg │ │ │ │ ├── navigation.svg │ │ │ │ ├── octagon.svg │ │ │ │ ├── package.svg │ │ │ │ ├── paperclip.svg │ │ │ │ ├── pause-circle.svg │ │ │ │ ├── pause.svg │ │ │ │ ├── percent.svg │ │ │ │ ├── phone-call.svg │ │ │ │ ├── phone-forwarded.svg │ │ │ │ ├── phone-incoming.svg │ │ │ │ ├── phone-missed.svg │ │ │ │ ├── phone-off.svg │ │ │ │ ├── phone-outgoing.svg │ │ │ │ ├── phone.svg │ │ │ │ ├── pie-chart.svg │ │ │ │ ├── play-circle.svg │ │ │ │ ├── play.svg │ │ │ │ ├── plus-circle.svg │ │ │ │ ├── plus-square.svg │ │ │ │ ├── plus.svg │ │ │ │ ├── pocket.svg │ │ │ │ ├── power.svg │ │ │ │ ├── printer.svg │ │ │ │ ├── radio.svg │ │ │ │ ├── refresh-ccw.svg │ │ │ │ ├── refresh-cw.svg │ │ │ │ ├── repeat.svg │ │ │ │ ├── rewind.svg │ │ │ │ ├── rotate-ccw.svg │ │ │ │ ├── rotate-cw.svg │ │ │ │ ├── save.svg │ │ │ │ ├── scissors.svg │ │ │ │ ├── search.svg │ │ │ │ ├── server.svg │ │ │ │ ├── settings.svg │ │ │ │ ├── share-2.svg │ │ │ │ ├── share.svg │ │ │ │ ├── shield.svg │ │ │ │ ├── shopping-cart.svg │ │ │ │ ├── shuffle.svg │ │ │ │ ├── sidebar.svg │ │ │ │ ├── skip-back.svg │ │ │ │ ├── skip-forward.svg │ │ │ │ ├── slack.svg │ │ │ │ ├── slash.svg │ │ │ │ ├── sliders.svg │ │ │ │ ├── smartphone.svg │ │ │ │ ├── speaker.svg │ │ │ │ ├── square.svg │ │ │ │ ├── star-on.svg │ │ │ │ ├── star.svg │ │ │ │ ├── stop-circle.svg │ │ │ │ ├── sun.svg │ │ │ │ ├── sunrise.svg │ │ │ │ ├── sunset.svg │ │ │ │ ├── tablet.svg │ │ │ │ ├── tag.svg │ │ │ │ ├── target.svg │ │ │ │ ├── thermometer.svg │ │ │ │ ├── thumbs-down.svg │ │ │ │ ├── thumbs-up.svg │ │ │ │ ├── toggle-left.svg │ │ │ │ ├── toggle-right.svg │ │ │ │ ├── trash-2.svg │ │ │ │ ├── trash.svg │ │ │ │ ├── trending-down.svg │ │ │ │ ├── trending-up.svg │ │ │ │ ├── triangle.svg │ │ │ │ ├── tv.svg │ │ │ │ ├── twitter.svg │ │ │ │ ├── type.svg │ │ │ │ ├── umbrella.svg │ │ │ │ ├── underline.svg │ │ │ │ ├── unlock.svg │ │ │ │ ├── upload-cloud.svg │ │ │ │ ├── upload.svg │ │ │ │ ├── user-check.svg │ │ │ │ ├── user-minus.svg │ │ │ │ ├── user-plus.svg │ │ │ │ ├── user-x.svg │ │ │ │ ├── user.svg │ │ │ │ ├── users.svg │ │ │ │ ├── video-off.svg │ │ │ │ ├── video.svg │ │ │ │ ├── voicemail.svg │ │ │ │ ├── volume-1.svg │ │ │ │ ├── volume-2.svg │ │ │ │ ├── volume-x.svg │ │ │ │ ├── volume.svg │ │ │ │ ├── watch.svg │ │ │ │ ├── wifi-off.svg │ │ │ │ ├── wifi.svg │ │ │ │ ├── wind.svg │ │ │ │ ├── x-circle.svg │ │ │ │ ├── x-square.svg │ │ │ │ ├── x.svg │ │ │ │ ├── zap.svg │ │ │ │ ├── zoom-in.svg │ │ │ │ └── zoom-out.svg │ │ ├── index │ │ │ ├── common.css │ │ │ ├── content.css │ │ │ ├── footer.css │ │ │ ├── header.css │ │ │ ├── index.css │ │ │ └── other.css │ │ ├── plugins │ │ │ └── overflow.css │ │ ├── scss │ │ │ └── variable.scss │ │ ├── style.scss │ │ ├── theme │ │ │ ├── theme-black.scss │ │ │ ├── theme-blue.scss │ │ │ ├── theme-gray.scss │ │ │ └── themes.scss │ │ └── ui │ │ │ └── ui.css │ └── images │ │ ├── 01.png │ │ ├── 02.png │ │ ├── 03.png │ │ ├── 04.png │ │ ├── 05.png │ │ ├── 06.png │ │ ├── hd.png │ │ ├── sidebar-divider-dots.png │ │ ├── sidebar-divider-dots2.png │ │ └── yes.png ├── components │ ├── js │ │ ├── layout.js │ │ └── penSettingDialog.js │ ├── layout.vue │ └── penSettingDialog.vue ├── config │ └── index.js ├── main.js ├── router │ └── index.js └── vs │ ├── common │ └── AMDLoader.js │ ├── core │ └── index.js │ ├── dialogs │ └── index.js │ ├── download │ └── index.js │ ├── editor │ ├── index.js │ ├── layout.js │ ├── layoutViews.js │ └── resizeLayout.js │ ├── events │ └── index.js │ ├── plugins │ └── index.js │ ├── services │ └── index.js │ ├── store │ └── index.js │ ├── theme │ └── index.js │ ├── utils │ └── index.js │ └── vs.all.js └── static ├── libs ├── download │ ├── Blob.js │ ├── FileSaver.js │ └── jszip.min.js └── webuploader │ ├── README.md │ ├── Uploader.swf │ ├── webuploader.css │ ├── webuploader.custom.js │ ├── webuploader.custom.min.js │ ├── webuploader.fis.js │ ├── webuploader.flashonly.js │ ├── webuploader.flashonly.min.js │ ├── webuploader.html5only.js │ ├── webuploader.html5only.min.js │ ├── webuploader.js │ ├── webuploader.min.js │ ├── webuploader.noimage.js │ ├── webuploader.noimage.min.js │ ├── webuploader.nolog.js │ ├── webuploader.nolog.min.js │ ├── webuploader.withoutimage.js │ └── webuploader.withoutimage.min.js └── tpl ├── js ├── body.js └── head.js ├── run1.html ├── run2.html ├── run3.html ├── run4.html ├── run5.html ├── run6.html ├── run7.html ├── run8.html ├── thematic.html └── zt └── base.css /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | presets: ['es2015', 'stage-0'] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-codepen 2 | > 线上访问地址 https://heqing0712.github.io/vue-codepen/ 3 | 4 | > 如果对您有帮助,您可以点右上角 "Star" 支持一下 谢谢! ^_^ 5 | 6 | > 这个是一个类似codepen的 vue项目,目前只实现了主要的前端部分,后端部分暂未实现,后期版本再跟进。 7 | 在线编辑器使用了 vscode 的web版编辑器 monaco-editor,因为vscode非常强大,相信后续扩展会更好一些。项目代码有些地方写得不友好的地方,还请大家指出来,一起去完善哦 ^_^。 8 | 9 | --- 10 | ##### 环境 11 | 1. node >= 4.0.0 12 | 2. npm >= 3.0.0 13 | 14 | 15 | ##### 技术栈 16 | 17 | > [vue](https://github.com/vuejs/vue) 18 | 19 | > [vue-resource](https://github.com/vuejs/vue-resource) 20 | 21 | > [webpack](http://webpack.github.io/docs/) 22 | 23 | > [monaco-editor](https://github.com/Microsoft/monaco-editor) 24 | 25 | > [es6-babel](https://babeljs.io/docs/learn-es2015/) 26 | 27 | --- 28 | ### 截图 29 | 30 | --- 31 | 32 |  33 |  34 |  35 |  36 |  37 |  38 | 39 | --- 40 | 41 | ### 安装 42 | 项目地址:(使用`git clone`) 43 | 44 | ```shell 45 | git clone https://github.com/heqing0712/vue-codepen.git 46 | ``` 47 | 48 | 通过`npm`安装本地服务第三方依赖模块(需要已安装[Node.js](https://nodejs.org/)),使用npm安装依赖模块可能会很慢,建议换成[cnpm](http://cnpmjs.org/) 49 | 50 | ```shell 51 | npm install -g cnpm --registry=http://registry.npm.taobao.org 52 | ``` 53 | 54 | ```bash 55 | # 安装依赖模块 56 | cnpm install 57 | 58 | # 启动服务 59 | npm run dev 60 | 61 | # 发布代码 62 | npm run build 63 | 64 | ``` 65 | 66 | ### 开发 67 | 68 | ### 目录结构 69 |
70 | . 71 | ├── README.md 72 | ├── dist // 项目build目录 73 | ├── config // 环境变量和入口,出口配置 74 | ├── libs // 参与打包的插件类库 75 | ├── static // 静态资源目录 76 | ├── build // 项目的配置文件目录 77 | │ ├── build.js // 打包的主入口 78 | │ ├── check-version.js // 检查输出打包库的版本 79 | │ ├── dev-client.js // 调试自动刷新配置 80 | │ ├── dev-server.js // 开发的服务配置 81 | │ ├── utils.js // 配置用到的工具类 82 | │ ├── vue-loader.js // vue文件加载配置 83 | │ ├── webpack-base-conf.js // 基本的Webpack 配置文件 84 | │ ├── webpack-dev-conf.js // 开发的Webpack 配置文件 85 | │ ├── webpack-prod-conf.js // 生产的Webpack 配置文件 86 | 87 | ├── package.json // 项目配置文件 88 | ├── src // 生产目录 89 | │ ├── assets // css js 和图片资源 90 | │ ├── components // 各种组件 91 | │ ├── config // 项目配置 92 | │ ├── router // 项目路由 目前主要首页 93 | │ ├── vs // vs编辑器主要文件夹 94 | │ └── app.vue // 根组件 95 | │ └── main.js // Webpack 预编译入口 96 | ├── index.html // 项目入口文件 97 | . 98 |99 | 100 | 101 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | var ora = require('ora') 6 | var rm = require('rimraf') 7 | var path = require('path') 8 | var chalk = require('chalk') 9 | var webpack = require('webpack') 10 | var config = require('../config') 11 | var webpackConfig = require('./webpack.prod.conf') 12 | 13 | var spinner = ora('building for production...') 14 | spinner.start() 15 | 16 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 17 | if (err) throw err 18 | webpack(webpackConfig, function (err, stats) { 19 | spinner.stop() 20 | if (err) throw err 21 | process.stdout.write(stats.toString({ 22 | colors: true, 23 | modules: false, 24 | children: false, 25 | chunks: false, 26 | chunkModules: false 27 | }) + '\n\n') 28 | 29 | if (stats.hasErrors()) { 30 | console.log(chalk.red(' Build failed with errors.\n')) 31 | process.exit(1) 32 | } 33 | 34 | console.log(chalk.cyan(' Build complete.\n')) 35 | console.log(chalk.yellow( 36 | ' Tip: built files are meant to be served over an HTTP server.\n' + 37 | ' Opening index.html over file:// won\'t work.\n' 38 | )) 39 | }) 40 | }) 41 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | var chalk = require('chalk') 2 | var semver = require('semver') 3 | var packageConfig = require('../package.json') 4 | var shell = require('shelljs') 5 | function exec (cmd) { 6 | return require('child_process').execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | } 15 | ] 16 | 17 | if (shell.which('npm')) { 18 | versionRequirements.push({ 19 | name: 'npm', 20 | currentVersion: exec('npm --version'), 21 | versionRequirement: packageConfig.engines.npm 22 | }) 23 | } 24 | 25 | module.exports = function () { 26 | var warnings = [] 27 | for (var i = 0; i < versionRequirements.length; i++) { 28 | var mod = versionRequirements[i] 29 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 30 | warnings.push(mod.name + ': ' + 31 | chalk.red(mod.currentVersion) + ' should be ' + 32 | chalk.green(mod.versionRequirement) 33 | ) 34 | } 35 | } 36 | 37 | if (warnings.length) { 38 | console.log('') 39 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 40 | console.log() 41 | for (var i = 0; i < warnings.length; i++) { 42 | var warning = warnings[i] 43 | console.log(' ' + warning) 44 | } 45 | console.log() 46 | process.exit(1) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | var config = require('../config') 4 | if (!process.env.NODE_ENV) { 5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 6 | } 7 | 8 | var opn = require('opn') 9 | var path = require('path') 10 | var express = require('express') 11 | var webpack = require('webpack') 12 | var proxyMiddleware = require('http-proxy-middleware') 13 | var webpackConfig = require('./webpack.dev.conf') 14 | 15 | // default port where dev server listens for incoming traffic 16 | var port = process.env.PORT || config.dev.port 17 | // automatically open browser, if not set will be false 18 | var autoOpenBrowser = !!config.dev.autoOpenBrowser 19 | // Define HTTP proxies to your custom API backend 20 | // https://github.com/chimurai/http-proxy-middleware 21 | var proxyTable = config.dev.proxyTable 22 | 23 | var app = express() 24 | var compiler = webpack(webpackConfig) 25 | 26 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 27 | publicPath: webpackConfig.output.publicPath, 28 | quiet: true 29 | }) 30 | 31 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 32 | log: false, 33 | heartbeat: 2000 34 | }) 35 | // force page reload when html-webpack-plugin template changes 36 | compiler.plugin('compilation', function (compilation) { 37 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 38 | hotMiddleware.publish({ action: 'reload' }) 39 | cb() 40 | }) 41 | }) 42 | 43 | // proxy api requests 44 | Object.keys(proxyTable).forEach(function (context) { 45 | var options = proxyTable[context] 46 | if (typeof options === 'string') { 47 | options = { target: options } 48 | } 49 | app.use(proxyMiddleware(options.filter || context, options)) 50 | }) 51 | 52 | // handle fallback for HTML5 history API 53 | app.use(require('connect-history-api-fallback')()) 54 | 55 | // serve webpack bundle output 56 | app.use(devMiddleware) 57 | 58 | // enable hot-reload and state-preserving 59 | // compilation error display 60 | app.use(hotMiddleware) 61 | 62 | // serve pure static assets 63 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 64 | app.use(staticPath, express.static('./static')) 65 | 66 | var uri = 'http://localhost:' + port 67 | 68 | var _resolve 69 | var readyPromise = new Promise(resolve => { 70 | _resolve = resolve 71 | }) 72 | 73 | console.log('> Starting dev server...') 74 | 75 | devMiddleware.waitUntilValid(() => { 76 | console.log('> Listening at ' + uri + '\n') 77 | // when env is testing, don't need open it 78 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 79 | opn(uri) 80 | } 81 | _resolve() 82 | }) 83 | 84 | var server = app.listen(port) 85 | 86 | module.exports = { 87 | ready: readyPromise, 88 | close: () => { 89 | server.close() 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heqing0712/vue-codepen/4180ba65fede913f3e60e0eabc8680cc34f13aed/build/utils.js -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var config = require('../config') 3 | var isProduction = process.env.NODE_ENV === 'production' 4 | 5 | module.exports = { 6 | 7 | 8 | loaders: utils.cssLoaders({ 9 | sourceMap: isProduction 10 | ? config.build.productionSourceMap 11 | : config.dev.cssSourceMap, 12 | extract: isProduction 13 | }), 14 | 15 | 16 | transformToRequire: { 17 | video: 'src', 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var config = require('../config') 4 | var vueLoaderConfig = require('./vue-loader.conf') 5 | var rootPath = path.resolve(__dirname, '../') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | module.exports = { 12 | entry: { 13 | app: './src/main.js' 14 | }, 15 | output: { 16 | path: config.build.assetsRoot, 17 | filename: '[name].js', 18 | publicPath: process.env.NODE_ENV === 'production' 19 | ? config.build.assetsPublicPath 20 | : config.dev.assetsPublicPath 21 | }, 22 | resolve: { 23 | extensions: ['.js', '.vue', '.json'], 24 | alias: { 25 | '@': resolve('src'), 26 | jquery: "jquery/dist/jquery.min.js", 27 | vue: 'vue/dist/vue.min.js', 28 | dialog: path.resolve(rootPath, "./libs/dialogwindows/dialog.js"), 29 | noty: path.resolve(rootPath, "./libs/noty/noty.js"), 30 | store: path.resolve(rootPath, "./libs/store/store.js"), 31 | template: path.resolve(rootPath, "./libs/art-template/template-web.js") 32 | } 33 | }, 34 | module: { 35 | rules: [ 36 | { 37 | test: /\.vue$/, 38 | loader: 'vue-loader', 39 | options: vueLoaderConfig 40 | }, 41 | { 42 | test: /\.js$/, 43 | loader: 'babel-loader', 44 | include: [resolve('src'), resolve('test')] 45 | }, 46 | { 47 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 48 | loader: 'url-loader', 49 | options: { 50 | limit: 10000, 51 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 52 | } 53 | }, 54 | { 55 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 56 | loader: 'url-loader', 57 | options: { 58 | limit: 10000, 59 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 60 | } 61 | }, 62 | { 63 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 64 | loader: 'url-loader', 65 | options: { 66 | limit: 10000, 67 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 68 | } 69 | } 70 | ] 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var webpack = require('webpack') 3 | var config = require('../config') 4 | var merge = require('webpack-merge') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 8 | var plugins = [ 9 | 10 | new webpack.DefinePlugin({ 11 | 'process.env': config.dev.env 12 | }), 13 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 14 | new webpack.HotModuleReplacementPlugin(), 15 | 16 | new webpack.NoEmitOnErrorsPlugin(), 17 | // https://github.com/ampedandwired/html-webpack-plugin 18 | 19 | 20 | new HtmlWebpackPlugin({ 21 | filename: 'index.html', 22 | template: 'src/app.html', 23 | inject: true 24 | }), 25 | 26 | new FriendlyErrorsPlugin() 27 | ]; 28 | 29 | 30 | // add hot-reload related code to entry chunks 31 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 32 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 33 | }) 34 | 35 | 36 | module.exports = merge(baseWebpackConfig, { 37 | module: { 38 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 39 | }, 40 | // cheap-module-eval-source-map is faster for development 41 | devtool: '#cheap-module-eval-source-map', 42 | plugins:plugins 43 | }) 44 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap:false, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | 25 | dev: { 26 | env: require('./dev.env'), 27 | port: 59458, 28 | autoOpenBrowser: true, 29 | assetsSubDirectory: 'static', 30 | assetsPublicPath: '/', 31 | proxyTable: { 32 | 33 | 34 | }, 35 | // CSS Sourcemaps off by default because relative paths are "buggy" 36 | // with this option, according to the CSS-Loader README 37 | // (https://github.com/webpack/css-loader#sourcemaps) 38 | // In our experience, they generally work as expected, 39 | // just be aware of this issue when enabling this option. 40 | cssSourceMap: true 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /dist/static/fonts/feather.0b17bdf.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heqing0712/vue-codepen/4180ba65fede913f3e60e0eabc8680cc34f13aed/dist/static/fonts/feather.0b17bdf.eot -------------------------------------------------------------------------------- /dist/static/fonts/feather.34f9a3a.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heqing0712/vue-codepen/4180ba65fede913f3e60e0eabc8680cc34f13aed/dist/static/fonts/feather.34f9a3a.woff -------------------------------------------------------------------------------- /dist/static/fonts/feather.ef0bf66.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heqing0712/vue-codepen/4180ba65fede913f3e60e0eabc8680cc34f13aed/dist/static/fonts/feather.ef0bf66.ttf -------------------------------------------------------------------------------- /dist/static/js/manifest.2ae2e69a05c33dfc65f8.js: -------------------------------------------------------------------------------- 1 | !function(r){function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var e=window.webpackJsonp;window.webpackJsonp=function(o,u,c){for(var f,i,p,a=0,l=[];a