Skip to content

Commit

Permalink
fix: alone [N] interpolation in to option (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Apr 24, 2019
1 parent 95cf57e commit 70917b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/isTemplateLike.js
@@ -1,4 +1,4 @@
export default (pattern) =>
/(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])/.test(
/(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])|(\[\d+\])/.test(
pattern
);
15 changes: 15 additions & 0 deletions test/CopyPlugin.test.js
Expand Up @@ -1808,6 +1808,21 @@ describe('apply function', () => {
.catch(done);
});

it('can move multiple files to a non-root directory with [1]', (done) => {
runEmit({
expectedAssetKeys: ['nested/txt'],
patterns: [
{
from: 'directory/nested/deep-nested',
to: 'nested/[1]',
test: /\.(.*)$/,
},
],
})
.then(done)
.catch(done);
});

it("can move a directory's contents to the root directory from symbolic link", (done) => {
runEmit({
// Windows doesn't support symbolic link
Expand Down

0 comments on commit 70917b7

Please sign in to comment.