mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-16 04:10:20 -06:00
@@ -2,9 +2,6 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = (api, { entry, name }, options) => {
|
||||
// inline all static asset files since there is no publicPath handling
|
||||
process.env.VUE_CLI_INLINE_LIMIT = Infinity
|
||||
|
||||
const { log, error } = require('@vue/cli-shared-utils')
|
||||
const abort = msg => {
|
||||
log()
|
||||
|
||||
@@ -33,12 +33,15 @@ module.exports = (api, options) => {
|
||||
}, extract && typeof extract === 'object' ? extract : {})
|
||||
|
||||
// use relative publicPath in extracted CSS based on extract location
|
||||
const cssPublicPath = '../'.repeat(
|
||||
extractOptions.filename
|
||||
.replace(/^\.[\/\\]/, '')
|
||||
.split(/[\/\\]/g)
|
||||
.length - 1
|
||||
)
|
||||
const cssPublicPath = process.env.VUE_CLI_BUILD_TARGET === 'lib'
|
||||
// in lib mode, CSS is extracted to dist root.
|
||||
? './'
|
||||
: '../'.repeat(
|
||||
extractOptions.filename
|
||||
.replace(/^\.[\/\\]/, '')
|
||||
.split(/[\/\\]/g)
|
||||
.length - 1
|
||||
)
|
||||
|
||||
// check if the project has a valid postcss config
|
||||
// if it doesn't, don't use postcss-loader for direct style imports
|
||||
|
||||
Reference in New Issue
Block a user