Created
November 29, 2017 01:03
-
-
Save ramsaylanier/a7c1a80405d023bdf35addb46f545384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| const path = require('path') | |
| const utils = require('./utils') | |
| const config = require('../config') | |
| const Config = require('config') | |
| const fs = require('fs') | |
| const vueLoaderConfig = require('./vue-loader.conf') | |
| // we'll use the Config package and write the output with a json file inside of the config directory | |
| fs.writeFileSync(path.resolve(__dirname, '../config/client.json'), JSON.stringify(Config)) | |
| function resolve (dir) { | |
| return path.join(__dirname, '..', dir) | |
| } | |
| module.exports = { | |
| entry: { | |
| app: './src/main.js' | |
| }, | |
| output: { | |
| path: config.build.assetsRoot, | |
| filename: '[name].js', | |
| publicPath: process.env.NODE_ENV === 'production' | |
| ? config.build.assetsPublicPath | |
| : config.dev.assetsPublicPath | |
| }, | |
| resolve: { | |
| extensions: ['.js', '.vue', '.json'], | |
| alias: { | |
| 'vue$': 'vue/dist/vue.esm.js', | |
| '@': resolve('src'), | |
| // we add this alias so we can import config on the client-side | |
| 'config': resolve('config/client.json') | |
| } | |
| }, | |
| // more stuff down here that is unchanged | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment