From 4049701d57faabf91436d4357b2ded2ee88edf7e Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Thu, 22 Dec 2016 10:41:55 +0900 Subject: [PATCH 001/328] change ko -> kr --- docs/LANGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LANGS.md b/docs/LANGS.md index 00ad892..42957cd 100644 --- a/docs/LANGS.md +++ b/docs/LANGS.md @@ -1,2 +1,2 @@ * [English](en/) -* [한국어](ko/) +* [한국어](kr/) From 64a75d63864deb13ef5f3b3f17629221a4e6c58d Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Thu, 22 Dec 2016 10:57:00 +0900 Subject: [PATCH 002/328] fix docs index link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e5a37f..180f044 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,4 @@ npm run dev This will setup a basic Webpack + `vue-loader` project for you, with `*.vue` files and hot-reloading working out of the box! -For advanced `vue-loader` configuration, checkout the [documentation](http://vuejs.github.io/vue-loader/). +For advanced `vue-loader` configuration, checkout the [documentation](http://vuejs.github.io/vue-loader/index.html). From cde72b5959d46cd2800230ac505eb889ba13cd24 Mon Sep 17 00:00:00 2001 From: Andre Asselin Date: Mon, 26 Dec 2016 05:24:38 -0500 Subject: [PATCH 003/328] Fix mockRender to work with the changes in compiler API introduced in vue/vue-template-compiler 2.1.5 and vue-template-es2015-compiler 1.3.2 (#550) --- test/test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index a9eea3d..e9bf6f1 100644 --- a/test/test.js +++ b/test/test.js @@ -73,7 +73,11 @@ function test (options, assert) { function mockRender (options, data) { return options.render.call(Object.assign({ - _h (tag, data, children) { + _v (val) { + return val + }, + _self: {}, + $createElement (tag, data, children) { if (Array.isArray(data)) { children = data data = null From 16b7af3d2bc2c0ca413516302c3e7121a3282eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B0=E5=BE=97?= Date: Mon, 26 Dec 2016 18:26:02 +0800 Subject: [PATCH 004/328] Update Posecss.md (#551) del wrong '}' --- docs/en/features/postcss.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/en/features/postcss.md b/docs/en/features/postcss.md index 4dbd8e1..c088bbe 100644 --- a/docs/en/features/postcss.md +++ b/docs/en/features/postcss.md @@ -31,7 +31,6 @@ module.exports = { options: { // ... postcss: [require('postcss-cssnext')()] - } } } ] From f7415b063c4b5a42d5243e65ade89705c05f92cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Thu, 5 Jan 2017 02:52:14 +0100 Subject: [PATCH 005/328] Explain SASS caveat (#517) * Explain SASS caveat improvement according to #453 * Update pre-processors.md * typo --- docs/en/configurations/pre-processors.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/en/configurations/pre-processors.md b/docs/en/configurations/pre-processors.md index dcc60e1..98ac447 100644 --- a/docs/en/configurations/pre-processors.md +++ b/docs/en/configurations/pre-processors.md @@ -18,6 +18,25 @@ npm install sass-loader node-sass --save-dev Under the hood, the text content inside the ` diff --git a/test/test.js b/test/test.js index 4e10972..e7809c5 100644 --- a/test/test.js +++ b/test/test.js @@ -330,6 +330,34 @@ describe('vue-loader', function () { }) }) + it('transformToRequire option', function (done) { + test({ + entry: './test/fixtures/transform.vue', + module: { + rules: [ + { test: /\.vue$/, loader: loaderPath }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader' + } + ] + } + }, function (window, module) { + function includeDataURL (s) { + return !!s.match(/\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*/i) + } + var vnode = mockRender(module) + // img tag + expect(includeDataURL(vnode.children[0].data.attrs.src)).to.equal(true) + // image tag (SVG) + expect(includeDataURL(vnode.children[2].children[0].data.attrs['xlink:href'])).to.equal(true) + var style = window.document.querySelector('style').textContent + // style + expect(includeDataURL(style)).to.equal(true) + done() + }) + }) + it('postcss options', function (done) { test({ entry: './test/fixtures/postcss.vue', From 0cb2d19dd0d137240429804d4dc3b0ba7f973faa Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Tue, 17 Jan 2017 12:28:23 +0900 Subject: [PATCH 015/328] add component name section to spec docs (#578) ref #495 --- docs/en/start/spec.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/start/spec.md b/docs/en/start/spec.md index c63f3cb..a8ae648 100644 --- a/docs/en/start/spec.md +++ b/docs/en/start/spec.md @@ -83,6 +83,10 @@ Beware that `src` imports follow the same path resolution rules to CommonJS `req + + diff --git a/test/test.js b/test/test.js index 79b21c8..99cead9 100644 --- a/test/test.js +++ b/test/test.js @@ -6,12 +6,14 @@ var webpack = require('webpack') var MemoryFS = require('memory-fs') var expect = require('chai').expect var genId = require('../lib/gen-id') +var SSR = require('vue-server-renderer') var compiler = require('../lib/template-compiler') var normalizeNewline = require('normalize-newline') var ExtractTextPlugin = require("extract-text-webpack-plugin") var SourceMapConsumer = require('source-map').SourceMapConsumer -var loaderPath = 'expose-loader?vueModule!' + path.resolve(__dirname, '../index.js') +var rawLoaderPath = path.resolve(__dirname, '../index.js') +var loaderPath = 'expose-loader?vueModule!' + rawLoaderPath var mfs = new MemoryFS() var globalConfig = { output: { @@ -49,6 +51,11 @@ function bundle (options, cb) { console.error(err.message) }) } + if (stats.compilation.errors) { + stats.compilation.errors.forEach(err => { + console.error(err.message) + }) + } expect(stats.compilation.errors).to.be.empty cb(mfs.readFileSync('/test.build.js').toString()) }) @@ -511,4 +518,36 @@ describe('vue-loader', function () { done() }) }) + + it('SSR style extraction', done => { + bundle({ + target: 'node', + entry: './test/fixtures/ssr-style.js', + output: { + path: '/', + filename: 'test.build.js', + libraryTarget: 'commonjs2' + }, + externals: ['vue'], + module: { + rules: [{ test: /\.vue$/, loader: rawLoaderPath }] + } + }, code => { + const renderer = SSR.createBundleRenderer(code) + const context = {} + renderer.renderToString(context, (err, res) => { + if (err) return done(err) + expect(res).to.contain('server-rendered') + expect(res).to.contain('

Hello

') + expect(res).to.contain('Hello from Component A!') + // from main component + expect(context.styles).to.contain('h1 { color: green;') + // from imported child component + expect(context.styles).to.contain('comp-a h2 {\n color: #f00;') + // from imported css file + expect(context.styles).to.contain('h1 { color: red;') + done() + }) + }) + }) }) From 1051df57b2f51d864f4d19958553e37335fce2bf Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 30 Jan 2017 22:21:36 -0500 Subject: [PATCH 039/328] bump deps --- lib/template-compiler.js | 4 +++- package.json | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/template-compiler.js b/lib/template-compiler.js index 224ec44..28efd72 100644 --- a/lib/template-compiler.js +++ b/lib/template-compiler.js @@ -100,5 +100,7 @@ module.exports = function (html) { } function toFunction (code) { - return 'function (){' + beautify(code, { indent_size: 2 }) + '}' + return 'function (){' + beautify(code, { + indent_size: 2 // eslint-disable-line camelcase + }) + '}' } diff --git a/package.json b/package.json index 2002a64..6e6b8ae 100644 --- a/package.json +++ b/package.json @@ -53,15 +53,15 @@ "coffee-loader": "^0.7.2", "coffee-script": "^1.10.0", "css-loader": "^0.26.0", - "eslint": "^2.9.0", - "eslint-config-vue": "^1.0.0", - "eslint-plugin-html": "^1.5.2", + "eslint": "^3.14.1", + "eslint-config-vue": "^2.0.2", + "eslint-plugin-vue": "^2.0.0", "expose-loader": "^0.7.1", "extract-text-webpack-plugin": "^2.0.0-rc.0", - "file-loader": "^0.9.0", + "file-loader": "^0.10.0", "inject-loader": "^2.0.0", "jsdom": "^9.2.1", - "memory-fs": "^0.3.0", + "memory-fs": "^0.4.1", "mkdirp": "^0.5.1", "mocha": "^3.2.0", "node-libs-browser": "^2.0.0", From 08a36eb50b028796908dbd11acff78aaf863d3d2 Mon Sep 17 00:00:00 2001 From: Andre Asselin Date: Tue, 31 Jan 2017 12:56:12 -0500 Subject: [PATCH 040/328] Add the vue template compiler onto any template loader specified in the vue.loaders configuration (#595) * Tweak to add the vue template compiler onto any loader specified in the vue.loaders configuration. This enables, for example, using a markdown loader via