Skip to content

Commit

Permalink
test: use import-map for src/dist testing
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Jan 13, 2023
1 parent 05e0c5a commit 4fa44a3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
"scripts": {
"build": "tsc",
"test": "tsx tests",
"dev": "tsx watch tests",
"dev": "tsx watch --conditions=development tests",
"lint": "eslint --cache ."
},
"imports": {
"#esbuild-loader": {
"types": "./src/index.ts",
"development": "./src/index.ts",
"default": "./dist/index.js"
}
},
"peerDependencies": {
"webpack": "^4.40.0 || ^5.0.0"
},
Expand All @@ -41,6 +48,7 @@
"devDependencies": {
"@pvtnbr/eslint-config": "^0.33.0",
"@types/loader-utils": "^2.0.3",
"@types/mini-css-extract-plugin": "^2.5.1",
"@types/node": "^18.11.18",
"@types/webpack": "^4.41.33",
"@types/webpack-sources": "^0.1.9",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/specs/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { testSuite, expect } from 'manten';
import { build } from 'webpack-test-utils';
import webpack4 from 'webpack';
import webpack5 from 'webpack5';
import type { MinifyPluginOptions } from '../../dist/index.js';
import type { MinifyPluginOptions } from '#esbuild-loader';
import {
configureEsbuildLoader,
configureCssLoader,
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { build } from 'webpack-test-utils';
import webpack4 from 'webpack';
import webpack5 from 'webpack5';
import * as esbuild from 'esbuild';
import type { MinifyPluginOptions } from '../../dist/index.js';
import type { MinifyPluginOptions } from '#esbuild-loader';
import {
configureEsbuildMinifyPlugin,
configureMiniCssExtractPlugin,
Expand Down
4 changes: 4 additions & 0 deletions tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "..",
"include": ["."]
}
2 changes: 1 addition & 1 deletion tests/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type webpack4 from 'webpack';
import type webpack5 from 'webpack5';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import { ESBuildMinifyPlugin, type MinifyPluginOptions } from '..';
import { ESBuildMinifyPlugin, type MinifyPluginOptions } from '#esbuild-loader';

const esbuildLoaderPath = require.resolve('../src/');

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"outDir": "dist",
"module": "commonjs",
"module": "Node16",

// Node 10
"target": "ES2018",
Expand Down

0 comments on commit 4fa44a3

Please sign in to comment.