0.3.5 • Published 3 years ago

yyl-vue2-webpack-config v0.3.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

yyl-vue2-webpack-config

安装

yarn add yyl-vue2-webpack-config

使用

// webpack.config.js
import yylVue2WebpackConfig from 'yyl-vue2-webpack-config'
import { merge } from 'webpack-merge'

module.exports = (env) => {
  ...merge({
    context: __dirname,
    env,
    alias: {
      '@': path.join(__dirname, './src'),
      '~@': path.join(__dirname, './src/components/')
    },
    yylConfig: {
      commit: {
        hostname: '//www.testhost.com',
        mainHost: 'http://www.testhost.com'
      }
    }
  })
}

文档

直接看 types 吧

import { Configuration } from 'webpack'
import { YylBaseInitConfigOption } from 'yyl-base-webpack-config'
export declare type WConfigVue2Result = Required<
  Pick<Configuration, 'module' | 'resolve' | 'plugins'>
>
declare function yylVue2WebpackConfig(op: YylBaseInitConfigOption): Configuration
export default yylVue2WebpackConfig