Skip to content

Commit

Permalink
fix: windows path error
Browse files Browse the repository at this point in the history
  • Loading branch information
caoli committed Oct 10, 2018
1 parent 4e833a6 commit 1ca1beb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ module.exports = function(source) {
const options = loaderUtils.getOptions(this) || {};
const config = { codeSegment: '' };
if (options.templateFile) {
config.codeSegment = `import codeSegment from '${options.templateFile}'
// fix windows path error
const templateFile = options.templateFile.replace(/\\/g, '\\\\');
config.codeSegment = `import codeSegment from '${templateFile}'
codeSegment(Vue);`;
}
const loader = this.target === 'node' ? node : web;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-entry-loader",
"version": "1.0.0",
"version": "1.0.1",
"description": "webpack vue entry loader",
"keywords": [
"webpack",
Expand Down

0 comments on commit 1ca1beb

Please sign in to comment.