mirror of https://github.com/vuejs/core.git
refactor(compiler-sfc): move related files into separate directories
This commit is contained in:
parent
869f3fb93e
commit
b2c874e3b9
|
@ -9,7 +9,7 @@ import {
|
|||
createAssetUrlTransformWithOptions,
|
||||
AssetURLOptions,
|
||||
normalizeOptions
|
||||
} from '../src/templateTransformAssetUrl'
|
||||
} from '../src/template/transformAssetUrl'
|
||||
import { transformElement } from '../../compiler-core/src/transforms/transformElement'
|
||||
import { transformBind } from '../../compiler-core/src/transforms/vBind'
|
||||
import { stringifyStatic } from '../../compiler-dom/src/transforms/stringifyStatic'
|
||||
|
|
|
@ -7,13 +7,13 @@ import {
|
|||
import {
|
||||
transformSrcset,
|
||||
createSrcsetTransformWithOptions
|
||||
} from '../src/templateTransformSrcset'
|
||||
} from '../src/template/transformSrcset'
|
||||
import { transformElement } from '../../compiler-core/src/transforms/transformElement'
|
||||
import { transformBind } from '../../compiler-core/src/transforms/vBind'
|
||||
import {
|
||||
AssetURLOptions,
|
||||
normalizeOptions
|
||||
} from '../src/templateTransformAssetUrl'
|
||||
} from '../src/template/transformAssetUrl'
|
||||
import { stringifyStatic } from '../../compiler-dom/src/transforms/stringifyStatic'
|
||||
|
||||
function compileWithSrcset(
|
||||
|
|
|
@ -2,7 +2,7 @@ import {
|
|||
isRelativeUrl,
|
||||
isExternalUrl,
|
||||
isDataUrl
|
||||
} from '../../compiler-sfc/src/templateUtils'
|
||||
} from '../src/template/templateUtils'
|
||||
|
||||
describe('compiler sfc:templateUtils isRelativeUrl', () => {
|
||||
test('should return true when The first character of the string path is .', () => {
|
||||
|
|
|
@ -53,13 +53,13 @@ import {
|
|||
CSS_VARS_HELPER,
|
||||
genCssVarsCode,
|
||||
genNormalScriptCssVarsCode
|
||||
} from './cssVars'
|
||||
} from './style/cssVars'
|
||||
import { compileTemplate, SFCTemplateCompileOptions } from './compileTemplate'
|
||||
import { warnOnce } from './warn'
|
||||
import { rewriteDefaultAST } from './rewriteDefault'
|
||||
import { createCache } from './cache'
|
||||
import { shouldTransform, transformAST } from '@vue/reactivity-transform'
|
||||
import { transformDestructuredProps } from './compileScriptPropsDestructure'
|
||||
import { transformDestructuredProps } from './script/propsDestructure'
|
||||
|
||||
// Special compiler macros
|
||||
const DEFINE_PROPS = 'defineProps'
|
||||
|
|
|
@ -5,16 +5,16 @@ import postcss, {
|
|||
Message,
|
||||
LazyResult
|
||||
} from 'postcss'
|
||||
import trimPlugin from './stylePluginTrim'
|
||||
import scopedPlugin from './stylePluginScoped'
|
||||
import trimPlugin from './style/pluginTrim'
|
||||
import scopedPlugin from './style/pluginScoped'
|
||||
import {
|
||||
processors,
|
||||
StylePreprocessor,
|
||||
StylePreprocessorResults,
|
||||
PreprocessLang
|
||||
} from './stylePreprocessors'
|
||||
} from './style/preprocessors'
|
||||
import { RawSourceMap } from 'source-map'
|
||||
import { cssVarsPlugin } from './cssVars'
|
||||
import { cssVarsPlugin } from './style/cssVars'
|
||||
import postcssModules from 'postcss-modules'
|
||||
|
||||
export interface SFCStyleCompileOptions {
|
||||
|
|
|
@ -13,17 +13,17 @@ import {
|
|||
createAssetUrlTransformWithOptions,
|
||||
AssetURLTagConfig,
|
||||
normalizeOptions
|
||||
} from './templateTransformAssetUrl'
|
||||
} from './template/transformAssetUrl'
|
||||
import {
|
||||
transformSrcset,
|
||||
createSrcsetTransformWithOptions
|
||||
} from './templateTransformSrcset'
|
||||
} from './template/transformSrcset'
|
||||
import { generateCodeFrame, isObject } from '@vue/shared'
|
||||
import * as CompilerDOM from '@vue/compiler-dom'
|
||||
import * as CompilerSSR from '@vue/compiler-ssr'
|
||||
import consolidate from '@vue/consolidate'
|
||||
import { warnOnce } from './warn'
|
||||
import { genCssVarsFromList } from './cssVars'
|
||||
import { genCssVarsFromList } from './style/cssVars'
|
||||
|
||||
export interface TemplateCompiler {
|
||||
compile(template: string, options: CompilerOptions): CodegenResult
|
||||
|
|
|
@ -52,7 +52,7 @@ export type { SFCScriptCompileOptions } from './compileScript'
|
|||
export type {
|
||||
AssetURLOptions,
|
||||
AssetURLTagConfig
|
||||
} from './templateTransformAssetUrl'
|
||||
} from './template/transformAssetUrl'
|
||||
export type {
|
||||
CompilerOptions,
|
||||
CompilerError,
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
import * as CompilerDOM from '@vue/compiler-dom'
|
||||
import { RawSourceMap, SourceMapGenerator } from 'source-map'
|
||||
import { TemplateCompiler } from './compileTemplate'
|
||||
import { parseCssVars } from './cssVars'
|
||||
import { parseCssVars } from './style/cssVars'
|
||||
import { createCache } from './cache'
|
||||
import { hmrShouldReload, ImportBinding } from './compileScript'
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
unwrapTSNode
|
||||
} from '@vue/compiler-core'
|
||||
import { genPropsAccessExp } from '@vue/shared'
|
||||
import { PropsDestructureBindings } from './compileScript'
|
||||
import { PropsDestructureBindings } from '../compileScript'
|
||||
|
||||
/**
|
||||
* true -> prop binding
|
|
@ -7,7 +7,7 @@ import {
|
|||
SimpleExpressionNode,
|
||||
BindingMetadata
|
||||
} from '@vue/compiler-dom'
|
||||
import { SFCDescriptor } from './parse'
|
||||
import { SFCDescriptor } from '../parse'
|
||||
import { PluginCreator } from 'postcss'
|
||||
import hash from 'hash-sum'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { PluginCreator, Rule, AtRule } from 'postcss'
|
||||
import selectorParser from 'postcss-selector-parser'
|
||||
import { warn } from './warn'
|
||||
import { warn } from '../warn'
|
||||
|
||||
const animationNameRE = /^(-\w+-)?animation-name$/
|
||||
const animationRE = /^(-\w+-)?animation$/
|
|
@ -1,6 +1,6 @@
|
|||
import merge from 'merge-source-map'
|
||||
import { RawSourceMap } from 'source-map'
|
||||
import { SFCStyleCompileOptions } from './compileStyle'
|
||||
import { SFCStyleCompileOptions } from '../compileStyle'
|
||||
import { isFunction } from '@vue/shared'
|
||||
|
||||
export type StylePreprocessor = (
|
|
@ -14,10 +14,7 @@ import {
|
|||
isExternalUrl,
|
||||
isDataUrl
|
||||
} from './templateUtils'
|
||||
import {
|
||||
AssetURLOptions,
|
||||
defaultAssetUrlOptions
|
||||
} from './templateTransformAssetUrl'
|
||||
import { AssetURLOptions, defaultAssetUrlOptions } from './transformAssetUrl'
|
||||
|
||||
const srcsetTags = ['img', 'source']
|
||||
|
Loading…
Reference in New Issue