mirror of
https://github.com/youzan/vant.git
synced 2026-05-10 01:06:44 +08:00
feat(cli): gen package entry in lib dir
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
module.exports = function(api: any) {
|
||||
const { BABEL_MODULE, NODE_ENV } = process.env;
|
||||
|
||||
const isTest = NODE_ENV === 'test';
|
||||
const useESModules = BABEL_MODULE !== 'commonjs' && !isTest;
|
||||
|
||||
api && api.cache(false);
|
||||
console.log('cache ??', useESModules, api);
|
||||
if (api) {
|
||||
console.log('never ed');
|
||||
api.cache.never();
|
||||
}
|
||||
|
||||
return {
|
||||
presets: [
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import merge from 'webpack-merge';
|
||||
import { join } from 'path';
|
||||
import { baseConfig } from './webpack.base';
|
||||
import { getVantConfig, getWebpackConfig, setBuildTarget } from '../common';
|
||||
import { LIB_DIR, PACKAGE_ENTRY_FILE } from '../common/constant';
|
||||
import { LIB_DIR, ES_DIR } from '../common/constant';
|
||||
|
||||
export function packageConfig(isMinify: boolean) {
|
||||
const { name } = getVantConfig();
|
||||
@@ -13,7 +14,7 @@ export function packageConfig(isMinify: boolean) {
|
||||
{
|
||||
mode: 'production',
|
||||
entry: {
|
||||
[name]: PACKAGE_ENTRY_FILE
|
||||
[name]: join(ES_DIR, 'index.js')
|
||||
},
|
||||
stats: 'none',
|
||||
output: {
|
||||
|
||||
Reference in New Issue
Block a user