Skip to content

Commit 70917b7

Browse files
authoredApr 24, 2019
fix: alone [N] interpolation in to option (#375)
1 parent 95cf57e commit 70917b7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
 

‎src/utils/isTemplateLike.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default (pattern) =>
2-
/(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])/.test(
2+
/(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])|(\[\d+\])/.test(
33
pattern
44
);

‎test/CopyPlugin.test.js

+15
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,21 @@ describe('apply function', () => {
18081808
.catch(done);
18091809
});
18101810

1811+
it('can move multiple files to a non-root directory with [1]', (done) => {
1812+
runEmit({
1813+
expectedAssetKeys: ['nested/txt'],
1814+
patterns: [
1815+
{
1816+
from: 'directory/nested/deep-nested',
1817+
to: 'nested/[1]',
1818+
test: /\.(.*)$/,
1819+
},
1820+
],
1821+
})
1822+
.then(done)
1823+
.catch(done);
1824+
});
1825+
18111826
it("can move a directory's contents to the root directory from symbolic link", (done) => {
18121827
runEmit({
18131828
// Windows doesn't support symbolic link

0 commit comments

Comments
 (0)
Please sign in to comment.