Skip to content

Commit

Permalink
chore: change the type to module (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolking authored Nov 27, 2023
1 parent 42eee08 commit 0bde2dd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"name": "components-helper",
"version": "2.1.5",
"description": "Based on the docs to provide code prompt files for vue component library",
"main": "lib/index.js",
"module": "lib/index.es.js",
"type": "module",
"main": "lib/index.cjs",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": {
"import": "./lib/index.es.js",
"require": "./lib/index.js"
"import": "./lib/index.js",
"require": "./lib/index.cjs"
}
},
"scripts": {
Expand Down Expand Up @@ -44,10 +45,10 @@
},
"homepage": "https://github.com/tolking/components-helper#readme",
"engines": {
"node": ">15.0.0"
"node": ">=16.0.0"
},
"dependencies": {
"fast-glob": "^3.2.11"
"fast-glob": "^3.3.2"
},
"devDependencies": {
"@types/node": "^18.0.6",
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ts from 'rollup-plugin-typescript2'

const commonConf = {
input: './src/index.ts',
external: ['fast-glob', 'fs', 'path'],
external: ['fast-glob'],
plugins: [
ts({
extensions: ['.ts'],
Expand All @@ -13,13 +13,13 @@ const commonConf = {

const list = [
{
file: 'lib/index.es.js',
file: 'lib/index.js',
format: 'es',
exports: 'named',
compact: true,
},
{
file: 'lib/index.js',
file: 'lib/index.cjs',
format: 'cjs',
exports: 'named',
compact: true,
Expand Down
2 changes: 1 addition & 1 deletion src/read.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFileSync } from 'fs'
import { readFileSync } from 'node:fs'

export function read(path: string): string {
return readFileSync(path, 'utf-8')
Expand Down
4 changes: 2 additions & 2 deletions src/write.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'path'
import { mkdir, writeFileSync } from 'fs'
import { resolve } from 'node:path'
import { mkdir, writeFileSync } from 'node:fs'
import type { Options, Tags, Props, WebTypes } from './type'

export function write(
Expand Down
3 changes: 1 addition & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const helper = require('../lib/index').default
import helper from '../lib/index.js'

helper({
name: 'test',
Expand Down

0 comments on commit 0bde2dd

Please sign in to comment.