• Home
  • Raw
  • Download

Lines Matching +full:config +full:- +full:array

10  *   http://www.apache.org/licenses/LICENSE-2.0
20 import loaderUtils from 'loader-utils'
40 const { DEVICE_LEVEL } = require('./lite/lite-enum')
49 babel: loadBabelModule('babel-loader'),
50 manifest: path.resolve(loaderPath, 'manifest-loader.js'),
51 resourceReferenceScript: path.resolve(loaderPath, 'resource-reference-script.js')
58 * @param {string} type - The type of loader needed (main/element/template/style/script/config/data)
59 * @param {Object} config - Configuration options for the loader including:
60 * - lang: Language specification
61 * - customLang: Custom language loaders
62 * - source: Source file path
63 * - app: Boolean flag for application scripts
64 * @returns {string} Webpack-compatible loader string
66 function getLoaderString (type, config) { argument
67 config = config || {}
68 const customLoader = loadCustomLoader(config)
74 return elementLoaderString(loaders, config)
76 return templateLoaderString(loaders, config, customLoader)
78 return styleLoaderString(loaders, config, customLoader)
80 return scriptLoaderString(loaders, config, customLoader)
81 case 'config':
82 return configLoaderString(loaders, config)
84 return dataLoaderString(loaders, config)
90 * Primarily used for loading Babel-compatible language processors (like TypeScript, Flow, etc.)
92 * @param {Object} config - Configuration object containing:
93 * - lang: The language to load (e.g., 'typescript', 'flow')
94 * - customLang: Map of available custom languages and their loaders
97 function loadCustomLoader (config) { argument
98 if (config.lang && config.customLang[config.lang]) {
99 return loadBabelModule(config.customLang[config.lang][0])
107 * @param {Array} loaders - Initial loader array (will be overridden)
108 * @returns {string} Webpack-compatible loader string with just the main loader
119 * Configures the main loader with element-specific options
121 * @param {Array} loaders - Initial loader array (will be overridden)
122 * @param {Object} config - Configuration options including:
123 * - source: Source file path (optional)
124 * @returns {string} Webpack-compatible loader string
126 function elementLoaderString (loaders, config) { argument
130 element: config.source ? undefined : true
140 * @param {Array} loaders - Initial loader array (will be overridden)
141 * @param {Object} config - Configuration options (currently unused)
142 * @param {Array} customLoader - Optional custom loaders to append
143 * @returns {string} Webpack-compatible loader string
145 function templateLoaderString (loaders, config, customLoader) { argument
161 * @param {Array} loaders - Initial loader configuration (will be overridden)
162 * @param {Object} config - Configuration options (unused in current implementation)
163 * @param {Array} customLoader - Optional array of custom loaders to append
164 * @returns {string} Webpack-compatible loader string
166 function styleLoaderString (loaders, config, customLoader) { argument
182 * @param {Array} loaders - Initial loader configuration (will be overridden)
183 * @param {Object} config - Configuration options including:
184 * - app: boolean indicating if processing app script
185 * - source: source file path
186 * @param {Array} customLoader - Optional custom loaders to include
187 * @returns {string} Webpack-compatible loader string
189 function scriptLoaderString (loaders, config, customLoader) { argument
198 'extends': path.resolve(__dirname, "../babel.config.js")
211 if (config.app && process.env.abilityType === 'page' &&
216 path: config.source
227 * @param {Array} loaders - Original loader array (gets overridden)
228 * @param {Object} config - Additional configuration options (currently unused)
229 * @returns {string} Webpack-compatible loader string
231 function configLoaderString (loaders, config) { argument
242 * @param {Array} loaders - Original loader configuration (overridden in this function)
243 * @param {Object} config - Additional configuration object (unused in current implementation)
246 function dataLoaderString (loaders, config) { argument
257 * @param {string} source - The source code of the file being processed
265 sass:['sass-loader'],
266 scss:['sass-loader'],
267 less:['less-loader']
303 * @param {Object} _this - Webpack loader context
318 * @param {Object} _this - Webpack loader context
319 * @param {string} name - Application name
320 * @param {boolean} isEntry - Whether this is an entry point
321 * @param {string} customLang - Custom language setting
322 * @param {string} source - Source content of the file
356 …$app_define$('@app-application/${name}', [], function($app_require$, $app_exports$, $app_module$) {
369 output += `$app_bootstrap$('@app-application/${name}'` + ',undefined' + ',undefined' + `)`
391 * @param {Object} _this - Webpack loader context
392 * @param {string} name - Name of the component/page
393 * @param {boolean} isEntry - Whether this is an entry point
394 * @param {string} customLang - Custom language setting
395 * @param {string} source - Source content of the file
396 * @param {string} parentPath - Path of the parent component
441 * @param {Object} _this - Webpack compilation context
442 * @param {number} elementLength - Number of custom elements to process
443 * @param {Object} frag - Fragment containing element definitions
444 * @param {Array} elementNames - Array to collect processed element names
445 * @param {string} resourcePath - Path of the parent resource
446 * @param {string} customLang - Custom language setting for loaders
447 * @param {string} parentPath - Path of the parent component
506 * @param {Object} _this - Webpack compilation context
507 * @param {string} filename - Base filename (without extension)
508 * @param {string} customLang - Custom language setting for the loader
510 * - extcss: boolean indicating if any style file exists
511 * - output: generated require statement or empty string
582 * @param {Object} _this - Webpack compilation context
583 * @param {string} filename - Base filename (without extension)
584 * @param {string} customLang - Custom language setting for the loader
586 * - extscript: boolean indicating if JS file exists
587 * - output: generated require statement or empty string
617 * @param {string} name - Component name
618 * @param {boolean} extscript - Whether the component has an external script
619 * @param {boolean} extcss - Whether the component has external CSS
620 * @param {boolean} isEntry - Whether this is an entry component
626 $app_define$('@app-component/${name}', [], function($app_require$, $app_exports$, $app_module$) {
640 output += `$app_bootstrap$('@app-component/${name}'` + ',undefined' + ',undefined' + `)`
649 * @param {boolean} extscript - Whether external script exists
650 * @param {boolean} extcss - Whether external CSS exists
667 * @param {Object} _this - Webpack compilation context object containing build information
668 * @param {string} filePath - Absolute file path to check
669 * @param {string} elementSrc - Page path from config file, used for warning message
677 reason: `WARNING: The page "${elementSrc}" configured in 'config.json'` +
679 … `To ensure that the debugging function is normal, please delete this page in 'config.json'.`