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