Every line of 'webpacker can't find application.js' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
12 function compileJs(resolve) { 13 throwOnMissingTargetProjectArgument('compile-js'); 14 throwOnInexistentTargetProject('compile-js'); 15 16 const compiler = webpack(webpackConfig); 17 compiler.run((error, stats) => { 18 outputBundlerStats(error, stats); 19 resolve(); 20 }); 21 }
22 function webpack(watch, callback) { 23 var webpackOptions = { 24 watch: watch, 25 module: { 26 preLoaders: [{ test: /\.js$/, exclude: /node_modules/, loader: 'jshint-loader'}], 27 loaders: [{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}] 28 }, 29 output: { filename: 'index.module.js' } 30 }; 31 32 if(watch) { 33 webpackOptions.devtool = 'inline-source-map'; 34 } 35 36 var webpackChangeHandler = function(err, stats) { 37 if(err) { 38 conf.errorHandler('Webpack')(err); 39 } 40 $.util.log(stats.toString({ 41 colors: $.util.colors.supportsColor, 42 chunks: false, 43 hash: false, 44 version: false 45 })); 46 browserSync.reload(); 47 if(watch) { 48 watch = false; 49 callback(); 50 } 51 }; 52 53 return gulp.src(path.join(conf.paths.src, '/app/index.module.js')) 54 .pipe($.webpack(webpackOptions, null, webpackChangeHandler)) 55 .pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app'))); 56 }
29 function launchWebpack(config: Object): Promise { 30 return new Promise((_resolve: Function) => { 31 let resolved = false 32 function resolve() { 33 if (!resolved) { 34 resolved = true 35 _resolve() 36 } 37 } 38 const compiler = webpack(config) 39 compiler.watch({}, (err: ?Error, stats: Object) => { 40 if (err) { 41 console.error(err.stack) 42 return 43 } 44 process.stdout.write(stats.toString({ 45 colors: true, 46 modules: false, 47 chunkModules: false, 48 chunks: true, 49 errorDetails: true, 50 }) + "\n") 51 if (stats.toJson().errors.length) return 52 resolve() 53 }) 54 }) 55 }
83 runWebpack(webpackConfig) { 84 return this.root.runWebpack(webpackConfig) 85 }
42 function webpack (done) { 43 return src('./js/app.js') 44 .pipe(webpackStream(webpack_param)) 45 .pipe(dest('dist')) 46 .on('error', e => { 47 // console.log(e) 48 done(e) 49 }) 50 .pipe(browserSync.stream()) 51 .on('end', e =>{ 52 done() 53 }) 54 }
158 private async runWebpack(): Promise { 159 return new Promise((resolve, reject) => { 160 this.webpack.run((err, stats) => { 161 if (err) { 162 this.consoleWrite(stats.toString()); 163 reject(err); 164 return; 165 } 166 if (stats.hasErrors()) { 167 this.consoleWrite(stats.toString()); 168 reject(new Error('webpack returned errors to ember-auto-import')); 169 return; 170 } 171 if (stats.hasWarnings() || process.env.AUTO_IMPORT_VERBOSE) { 172 this.consoleWrite(stats.toString()); 173 } 174 resolve(stats.toJson()); 175 }); 176 }); 177 }
133 function _js(file) { 134 webpack(webpackConfig(_env, file), (err, stats) => { 135 if (err) { 136 console.error(err.stack || err); 137 if (err.details) { 138 console.error(err.details); 139 } 140 return; 141 } 142 console.log(stats.toString({ 143 chunks: false, // 使构建过程更静默无输出 144 colors: true // 在控制台展示颜色 145 })); 146 }); 147 }
13 export function isAppJS(projectDir, path) { 14 15 projectDir = resolve(projectDir) 16 path = resolve(path) 17 18 return folderNames 19 .map(name => join(projectDir, 'Resources', name, 'app.js')) 20 .some(appPath => path === appPath) 21 }
29 function runWebpack(next) { 30 config.logger.log('Webpack running...') 31 return webpack(webpackConfig).watch({}, (err, stats) => { 32 if (err) { 33 config.logger.error(err, 'app.js'); 34 } 35 config.logger.log('Webpack finished'); 36 next(); 37 }); 38 }
26 function bundleFesm2015Module(name: string) { 27 return bundle({ 28 src: `${LIB_DIR}/${name}/esm2015/**/*.js`, 29 moduleName: `nb.${name}`, 30 entry: `${LIB_DIR}/${name}/esm2015/index.js`, 31 format: 'es', 32 output: `index.js`, 33 dest: `${LIB_DIR}/${name}/fesm2015`, 34 }); 35 }