refactor(@vant/cli): migrate to ESM package

This commit is contained in:
chenjiahan
2021-10-28 20:09:00 +08:00
committed by neverland
parent eec2ac4c0f
commit 1b45f38133
50 changed files with 255 additions and 196 deletions
@@ -1,8 +1,9 @@
import { join } from 'path';
import { existsSync } from 'fs-extra';
import { smartOutputFile, normalizePath } from '../common';
import { CSS_LANG, getCssBaseFile } from '../common/css';
import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant';
import { existsSync } from 'fs';
import { createRequire } from 'module';
import { smartOutputFile, normalizePath } from '../common/index.js';
import { CSS_LANG, getCssBaseFile } from '../common/css.js';
import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js';
type Options = {
outputPath: string;
@@ -10,6 +11,7 @@ type Options = {
};
export function genPackageStyle(options: Options) {
const require = createRequire(import.meta.url);
const styleDepsJson = require(STYLE_DEPS_JSON_FILE);
const ext = '.' + CSS_LANG;