• webpack-dev-server.js


    var path = require('path')
    var config = require('../config')
    var utils = require('./utils')
    var projectRoot = path.resolve(__dirname, '../')
    
    module.exports = {
    	entry: {
    		app: './src/main.js'
    	},
    	output: {
    		path: config.build.assetsRoot,
    		publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
    		filename: '[name].js'
    	},
    	resolve: {
    		extensions: ['', '.js', '.vue'],
    		fallback: [path.join(__dirname, '../node_modules')],
    		alias: {
    			'src': path.resolve(__dirname, '../src'),
    			'common': path.resolve(__dirname, '../src/common'),
    			'components': path.resolve(__dirname, '../src/components')
    		}
    	},
    	resolveLoader: {
    		fallback: [path.join(__dirname, '../node_modules')]
    	},
    	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'
    			},
    			{
    				test: /.js$/,
    				loader: 'babel',
    				include: projectRoot,
    				exclude: /node_modules/
    			},
    			{
    				test: /.json$/,
    				loader: 'json'
    			},
    			{
    				test: /.html$/,
    				loader: 'vue-html'
    			},
    			{
    				test: /.(png|jpe?g|gif|svg)(?.*)?$/,
    				loader: 'url',
    				query: {
    					limit: 10000,
    					name: utils.assetsPath('img/[name].[hash:7].[ext]')
    				}
    			},
    			{
    				test: /.(woff2?|eot|ttf|otf)(?.*)?$/,
    				loader: 'url',
    				query: {
    					limit: 10000,
    					name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
    				}
    			}
    		]
    	},
    	eslint: {
    		formatter: require('eslint-friendly-formatter')
    	},
    	vue: {
    		loaders: utils.cssLoaders()
    	}
    }
    
    
    You can change the world with your heart,even a lot of changes sometimes unless you won't geiv up....
  • 相关阅读:
    bootstrap学习笔记之基础导航条 http://www.imooc.com/code/3111
    bootstrap学习笔记之导航条基础
    Bootstrap学习笔记之文本对齐风格
    leetcode------Find Peak Element
    leetcode------Search a 2D Matrix
    leetcode------Set Matrix Zeroes
    【python】enumerate函数
    leetcode------Gray Code
    leetcode------Letter Combinations of a Phone Number
    leetcode------Best Time to Buy and Sell Stock II
  • 原文地址:https://www.cnblogs.com/xiongwei2017/p/6654346.html
Copyright © 2020-2023  润新知