Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit def3703

Browse filesBrowse files
committed
always use absolute path for lib files (close vuejs#525)
1 parent 49795c6 commit def3703
Copy full SHA for def3703

File tree

Expand file treeCollapse file tree

3 files changed

+7
-10
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-10
lines changed

‎lib/loader.js

Copy file name to clipboardExpand all lines: lib/loader.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,17 @@ var defaultLang = {
3636
module.exports = function (content) {
3737
this.cacheable()
3838
var isServer = this.options.target === 'node'
39+
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
40+
3941
var loaderContext = this
4042
var query = loaderUtils.parseQuery(this.query)
4143
var options = this.options.__vueOptions__ = Object.assign({}, this.options.vue, this.vue, query)
44+
4245
var filePath = this.resourcePath
4346
var fileName = path.basename(filePath)
4447
var moduleId = 'data-v-' + genId(filePath)
4548
var styleRewriter = styleRewriterPath + '?id=' + moduleId
4649

47-
var isProduction = this.minimize || process.env.NODE_ENV === 'production'
48-
4950
var needCssSourceMap =
5051
!isProduction &&
5152
this.sourceMap &&

‎lib/normalize.js

Copy file name to clipboardExpand all lines: lib/normalize.js
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ var fs = require('fs')
33
var path = require('path')
44

55
exports.lib = function (file) {
6-
if (IS_TEST) {
7-
return path.resolve(__dirname, file)
8-
} else {
9-
return 'vue-loader/lib/' + file
10-
}
6+
return path.resolve(__dirname, file)
117
}
128

139
exports.dep = function (dep) {

‎test/test.js

Copy file name to clipboardExpand all lines: test/test.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
process.env.VUE_LOADER_TEST = true
22

33
var path = require('path')
4+
var jsdom = require('jsdom')
45
var webpack = require('webpack')
56
var MemoryFS = require('memory-fs')
6-
var jsdom = require('jsdom')
77
var expect = require('chai').expect
88
var genId = require('../lib/gen-id')
9-
var SourceMapConsumer = require('source-map').SourceMapConsumer
10-
var ExtractTextPlugin = require("extract-text-webpack-plugin")
119
var compiler = require('../lib/template-compiler')
1210
var normalizeNewline = require('normalize-newline')
11+
var ExtractTextPlugin = require("extract-text-webpack-plugin")
12+
var SourceMapConsumer = require('source-map').SourceMapConsumer
1313

1414
var loaderPath = 'expose-loader?vueModule!' + path.resolve(__dirname, '../index.js')
1515
var mfs = new MemoryFS()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.