File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed
Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ const banner =
1212 ' * Released under the MIT License.\n' +
1313 ' */'
1414
15- const baseAlias = require ( './alias' )
16-
1715const builds = {
1816 // Runtime only (CommonJS). Used by bundlers e.g. Webpack & Browserify
1917 'web-runtime-dev' : {
@@ -43,21 +41,15 @@ const builds = {
4341 dest : path . resolve ( __dirname , '../dist/vue.js' ) ,
4442 format : 'umd' ,
4543 env : 'development' ,
46- banner,
47- alias : {
48- he : './entity-decoder'
49- }
44+ banner
5045 } ,
5146 // Runtime+compiler standalone production build.
5247 'web-standalone-prod' : {
5348 entry : path . resolve ( __dirname , '../src/entries/web-runtime-with-compiler.js' ) ,
5449 dest : path . resolve ( __dirname , '../dist/vue.min.js' ) ,
5550 format : 'umd' ,
5651 env : 'production' ,
57- banner,
58- alias : {
59- he : './entity-decoder'
60- }
52+ banner
6153 } ,
6254 // Web compiler (CommonJS).
6355 'web-compiler' : {
@@ -86,7 +78,7 @@ function genConfig (opts) {
8678 plugins : [
8779 flow ( ) ,
8880 buble ( ) ,
89- alias ( Object . assign ( { } , baseAlias , opts . alias ) )
81+ alias ( require ( './ alias' ) )
9082 ]
9183 }
9284
Original file line number Diff line number Diff line change 11/* @flow */
22
3- const decoder = document . createElement ( 'div' )
3+ import { inBrowser } from 'core/util/env'
44
5- export function decode ( html : string ) : string {
6- decoder . innerHTML = html
7- return decoder . textContent
5+ let decode
6+
7+ /* istanbul ignore else */
8+ if ( inBrowser ) {
9+ const decoder = document . createElement ( 'div' )
10+ decode = ( html : string ) : string => {
11+ decoder . innerHTML = html
12+ return decoder . textContent
13+ }
14+ } else {
15+ decode = require ( 'he' ) . decode
816}
17+
18+ export { decode }
Original file line number Diff line number Diff line change 11/* @flow */
22
3- import { decode } from 'he '
3+ import { decode } from './entity-decoder '
44import { parseHTML } from './html-parser'
55import { parseText } from './text-parser'
66import { cached , no , camelize } from 'shared/util'
You can’t perform that action at this time.
0 commit comments