Skip to content

Commit b3d63f0

Browse files
authored
fix: Use named import querystring module (vuejs#199)
fixes vuejs#198
1 parent 11739b4 commit b3d63f0

File tree

8 files changed

+479
-462
lines changed

8 files changed

+479
-462
lines changed

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
collectCoverageFrom: ['src/**'],
3-
moduleFileExtensions: ['js', 'ts'],
3+
moduleFileExtensions: ['js', 'ts', 'json'],
44
transform: {
55
'^.+\\.ts$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
66
},

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
},
2525
"scripts": {
2626
"prepublishOnly": "yarn build",
27-
"prebuild": "yarn lint && yarn test",
27+
"prebuild": "yarn lint",
2828
"build": "tsc",
2929
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
3030
"docs": "typedoc typings src/index.ts",
3131
"lint": "prettier --no-semi --single-quote --write **/*.js **/*.vue !test/target/** !dist/**",
3232
"release": "standard-version -a",
33+
"pretest": "yarn build",
3334
"test": "jest"
3435
},
3536
"files": [
@@ -38,10 +39,11 @@
3839
],
3940
"dependencies": {
4041
"@babel/runtime": "^7.0.0-beta.46",
41-
"@vue/component-compiler": "^3.3.1",
42+
"@vue/component-compiler": "^3.3.2",
4243
"@vue/component-compiler-utils": "^1.2.1",
4344
"debug": "^2.6.0",
4445
"hash-sum": "^1.0.2",
46+
"postcss": "^6.0.22",
4547
"querystring": "^0.2.0",
4648
"rollup-pluginutils": "^2.0.1"
4749
},
@@ -56,15 +58,16 @@
5658
"@znck/promised": "^1.0.0",
5759
"babel-core": "7.0.0-bridge.0",
5860
"babel-jest": "^22.4.3",
61+
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
5962
"conventional-changelog": "^1.1.24",
6063
"jest": "^22.4.2",
6164
"node-sass": "^4.9.0",
6265
"prettier": "^1.12.1",
6366
"pug": "^2.0.3",
64-
"puppeteer": "^1.3.0",
67+
"puppeteer": "^1.4.0",
6568
"rollup": "^0.58.2",
6669
"rollup-plugin-babel": "^4.0.0-beta.4",
67-
"rollup-plugin-commonjs": "^9.1.0",
70+
"rollup-plugin-commonjs": "^9.1.3",
6871
"rollup-plugin-css-only": "^0.4.0",
6972
"rollup-plugin-image": "^1.0.2",
7073
"rollup-plugin-md": "^0.0.7",

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default function VuePlugin(opts: VuePluginOptions = {}): Plugin {
125125
const descriptors = new Map<string, SFCDescriptor>()
126126

127127
return {
128-
name: 'vue.delegate',
128+
name: 'VuePlugin',
129129

130130
resolveId(id, importer) {
131131
if (!isVuePartRequest(id)) return

src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
SFCCustomBlock
55
} from '@vue/component-compiler-utils'
66
import { createFilter } from 'rollup-pluginutils'
7-
import queryString from 'querystring'
7+
import * as queryString from 'querystring'
88
import * as path from 'path'
99

1010
const GET_QUERY = /\.vue(\.[a-z]+?)?\?(.+)$/i

test/setup/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {rollup} from 'rollup'
55
import promised from '@znck/promised'
66

77
import {pluginCreateVueApp, plugins} from "./plugins"
8-
import pluginVue from '../../src'
8+
import pluginVue from '../..'
99

1010
const pluginCSS = require('rollup-plugin-css-only')
1111

test/setup/plugins.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
const pluginBabel = require('rollup-plugin-babel')
22
const pluginNodeResolve = require('rollup-plugin-node-resolve')
3+
const pluginCommonJS = require('rollup-plugin-commonjs')
34
const pluginImage = require('rollup-plugin-image')
45
const pluginMarkdown = require('rollup-plugin-md')
56

67
export const plugins = [
78
pluginImage(),
89
pluginMarkdown(),
910
pluginNodeResolve(),
11+
pluginCommonJS(),
1012
pluginBabel({
1113
presets: [
1214
[require.resolve('@babel/preset-env'), {

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"baseUrl": ".",
44
"outDir": "dist",
55
"sourceMap": false,
6-
"target": "es2015",
6+
"target": "es6",
77
"module": "commonjs",
88
"moduleResolution": "node",
99
"declaration": true,

0 commit comments

Comments
 (0)