Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default lang options #1813

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/codegen/styleInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = function genStyleInjectionCode (
resourcePath,
stringifyRequest,
needsHotReload,
needsExplicitInjection
needsExplicitInjection,
defaultStyleLang,
) {
let styleImportsCode = ``
let styleInjectionCode = ``
Expand All @@ -20,7 +21,7 @@ module.exports = function genStyleInjectionCode (

function genStyleRequest (style, i) {
const src = style.src || resourcePath
const attrsQuery = attrsToQuery(style.attrs, 'css')
const attrsQuery = attrsToQuery(style.attrs, defaultStyleLang || 'css')
const inheritQuery = `&${loaderContext.resourceQuery.slice(1)}`
// make sure to only pass id when necessary so that we don't inject
// duplicate tags when multiple components import the same css file
Expand Down
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module.exports = function (source) {
let scriptImport = `var script = {}`
if (descriptor.script) {
const src = descriptor.script.src || resourcePath
const attrsQuery = attrsToQuery(descriptor.script.attrs, 'js')
const attrsQuery = attrsToQuery(descriptor.script.attrs, options.defaultScriptLang || 'js')
const query = `?vue&type=script${attrsQuery}${inheritQuery}`
const request = stringifyRequest(src + query)
scriptImport = (
Expand All @@ -143,7 +143,8 @@ module.exports = function (source) {
resourcePath,
stringifyRequest,
needsHotReload,
isServer || isShadow // needs explicit injection?
isServer || isShadow, // needs explicit injection?
options.defaultStyleLang,
)
}

Expand Down