1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- var Path = require('path');
- var LiveReloadPlugin = require('webpack-livereload-plugin')
- var ExtractTextPlugin = require('extract-text-webpack-plugin')
- var prod = process.env.NODE_ENV === 'production'
- module.exports = {
- entry: Path.resolve('src/index.js'),
- output: {
- path: Path.resolve('static/src'),
- filename: 'main.js'
- },
- resolve: {
- extensions: ['.js', '.vue', '.json'],
- alias: {
- 'vue$': 'vue/dist/vue.esm.js',
- '@': Path.resolve('src')
- }
- },
- plugins: [
- new LiveReloadPlugin(),
- new ExtractTextPlugin('main.css')
- ],
- module: {
- rules: [
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: {
- extractCSS: prod
- }
- },
- {
- test: /\.js$/,
- exclude: /node_modules/,
- loader: 'babel-loader',
- include: Path.resolve('src')
- },
- {
- test: /\.css$/,
- loader: ['style-loader', 'css-loader']
- },
- {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: Path.posix.join('static', 'img/[name].[hash:7].[ext]')
- }
- }
- ]
- }
- }
|