Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
environment:
matrix:
- nodejs_version: '6'
- nodejs_version: '4'
install:
- ps: Install-Product node $env:nodejs_version
- npm install
matrix:
fast_finish: true
build: off
shallow_clone: true
test_script:
- npm run test
2 changes: 1 addition & 1 deletion src/preProcessPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function preProcessPattern(globalRef, pattern) {
.statAsync(pattern.absoluteFrom)
.catch(() => {
// If from doesn't appear to be a glob, then log a warning
if (isGlob(pattern.from)) {
if (isGlob(pattern.from) || pattern.from.indexOf('*') !== -1) {
pattern.fromType = 'glob';
} else {
const msg = `unable to locate '${pattern.from}' at '${pattern.absoluteFrom}'`;
Expand Down
6 changes: 3 additions & 3 deletions src/writeFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default function writeFile(globalRef, pattern, file) {
// A hack because loaderUtils.interpolateName doesn't
// find the right path if no directory is defined
// ie. [path] applied to 'file.txt' would return 'file'
if (file.relativeFrom.indexOf('/') < 0) {
file.relativeFrom = '/' + file.relativeFrom;
if (file.relativeFrom.indexOf(path.sep) < 0) {
file.relativeFrom = path.sep + file.relativeFrom;
}

file.webpackTo = loaderUtils.interpolateName(
Expand All @@ -60,7 +60,7 @@ export default function writeFile(globalRef, pattern, file) {
// Add back removed dots
if (dotRemoved) {
let newBasename = path.basename(file.webpackTo);
file.webpackTo = path.join(path.dirname(file.webpackTo), '.' + newBasename);
file.webpackTo = path.dirname(file.webpackTo) + '/.' + newBasename;
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ describe('apply function', () => {
runEmit({
expectedAssetKeys: [],
expectedErrors: [
`[copy-webpack-plugin] unable to locate 'nonexistent.txt' at '${HELPER_DIR}/nonexistent.txt'`
`[copy-webpack-plugin] unable to locate 'nonexistent.txt' at '${HELPER_DIR}${path.sep}nonexistent.txt'`
],
patterns: [{
from: 'nonexistent.txt'
Expand Down Expand Up @@ -821,7 +821,7 @@ describe('apply function', () => {
runEmit({
expectedAssetKeys: [],
expectedErrors: [
`[copy-webpack-plugin] unable to locate 'nonexistent' at '${HELPER_DIR}/nonexistent'`
`[copy-webpack-plugin] unable to locate 'nonexistent' at '${HELPER_DIR}${path.sep}nonexistent'`
],
patterns: [{
from: 'nonexistent'
Expand Down