vue-cnodejs学习-目录创建 环境配置
来源:互联网 发布:superslide.min.js 编辑:程序博客网 时间:2024/06/05 07:31
├── README.md
├── dist // 项目build目录
├── index.html // 项目入口文件
├── package.json // 项目配置文件
├── src // 生产目录
│ ├── assets // css js 和图片资源
│ ├── components // 各种组件
│ ├── views // 各种页面
│ ├── vuex // vuex状态管理器
│ ├── filters.js // 各种过滤器
│ └── main.js // Webpack 预编译入口
├── server.js // webpack-dev-server服务配置
└── webpack.config.js // Webpack 配置文件
webpack.config.js
'use strict'var path = require('path')var webpack = require('webpack')var ExtractTextPlugin = require('extract-text-webpack-plugin')var isProduction = () => { return process.env.NODE_ENV === 'production'}var projectRoot = path.resolve(__dirname, './src')// webpack插件var plugins = [ // 提公用js到common.js文件中 new webpack.optimize.CommonsChunkPlugin('common.js'), // 将样式统一发布到style.css中 new ExtractTextPlugin('style.css', { allChunks: true, disable: false }), // 使用 ProvidePlugin 加载使用率高的依赖库 new webpack.ProvidePlugin({ $: 'webpack-zepto' })]let entry = ['./src/main']let cdnPrefix = ''let buildPath = '/dist/'let publishPath = cdnPrefix + buildPath // 生产环境js压缩和图片cdnif (isProduction()) { // plugins.push(new webpack.optimize.UglifyJsPlugin()); cdnPrefix = '' publishPath = cdnPrefix}// 编译输出路径module.exports = { debug: true, entry: entry, output: { path: __dirname + buildPath, filename: 'build.js', publicPath: publishPath, chunkFilename: '[id].build.js?[chunkhash]' }, module: { preLoaders: [{ test: /\.vue$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ }, { test: /\.js$/, loader: 'eslint', include: projectRoot, exclude: /node_modules/ }], loaders: [{ test: /\.vue$/, loader: 'vue-loader' }, { test: /\.scss$/, loader: ExtractTextPlugin.extract( 'style-loader', 'css-loader?sourceMap!sass-loader!autoprefixer?{browsers:["last 2 version", "> 1%"]}') }, { test: /\.css$/, loader: ExtractTextPlugin.extract( 'style-loader', 'css-loader?sourceMap!cssnext-loader') }, { test: /\.js$/, exclude: /node_modules|vue\/dist/, loader: 'babel' }, { test: /\.(jpg|png|gif)$/, loader: 'file-loader?name=images/[hash].[ext]' }, { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&minetype=application/font-woff' }, { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }, { test: /\.json$/, loader: 'json' }, { test: /\.(html|tpl)$/, loader: 'html-loader' }] }, resolve: { // require时省略的扩展名,如:require('module') 不需要module.js extension: ['', '.js'], // 别名 alias: { filter: path.join(__dirname, 'src/filters'), vue: 'vue/dist/vue.js' } }, plugins: plugins, devtool: '#source-map'}
0 0
- vue-cnodejs学习-目录创建 环境配置
- ros学习1--创建工作目录及环境配置
- vue项目环境配置、创建及启动
- vue的学习记录--环境配置
- vue.js环境配置
- vue.js 环境配置
- vue.js环境配置
- VUE环境配置
- 配置Vue开发环境
- Vue.js环境配置
- win7配置vue环境
- 基于vue.js重写Cnodejs.org社区的webapp
- 基于vue.js重写Cnodejs.org社区的webapp
- vue环境搭建,vue项目创建
- vue.js学习02之vue-cli脚手架创建项目环境搭建
- Vue.js学习系列(一)---配置开发环境
- Vue.js学习系列(二)---配置开发环境
- Vue.js学习之路—环境配置
- Spark SQL电影分析案例
- iOS-图文表并茂,手把手教你GCD
- 1613-3-傅溥衍 总结《2016年11月2日》【连续三十三天总结】
- 《大话数据结构》
- 杭电OJ 1005
- vue-cnodejs学习-目录创建 环境配置
- leetcode_111. Minimum Depth of Binary Tree 二叉树的最小深度
- Lightoj 1342(求期望)
- EX03_01
- 《大话数据结构》
- Android Selector全解
- 杭电OJ 2000
- coredata学习总结(四)
- kubernetes1.4新特性:支持sysctl命令