Skip to content

Commit

Permalink
test: add case for umi babel-plugin-dynamic-import-node
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Aug 8, 2024
1 parent 417da4b commit ceb0cea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
mako: {},
extraBabelPlugins: ['babel-plugin-dynamic-import-node'],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'a';
11 changes: 11 additions & 0 deletions e2e/fixtures.umi/config.babel-plugin-dynamic-import-node/expect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const assert = require("assert");
const { parseBuildResult } = require("../../../scripts/test-utils");
const { files } = parseBuildResult(__dirname);

const jsFilesCount = Object.keys(files).filter(f => f.endsWith('.js')).length;

assert.equal(
jsFilesCount,
1,
'should output one js file',
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
console.log('single file');

import('../async');

0 comments on commit ceb0cea

Please sign in to comment.