webpack中文

WebPack TypeError: Cannot read property 'request' of undefined

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've inherited an existing Angular2 project. When I run NPM start I get a long error beginning with: Html Webpack Plugin: TypeError: Cannot read property 'request' of undefined ... Full error output: http://textuploader.com/d5n25 Any ideas what this means and how I can debug this to find out the file/line of code that is the problem? Also on Windows 8.1 if that information helps. 回答1: I had the same issue. Mine came from multiple versions of both webpack and HTML Webpack Plugin. Check with npm ls webpack html-webpack-plugin whether you are

Webpack 4 - Module parse failed: Unexpected character '@'

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently upgraded from Webpack 3 to 4. It's now throwing an error: Module parse failed: Unexpected character '@' You may need an appropriate loader to handle this file type. | @import './scss/variables.scss'; | | * { @ ./src/index.js 1:0-22 In my styles.scss file, I am doing the following: @import 'scss/variables.scss'; * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, Helvetica, sans-serif; } In my index.js file, I am only doing the following: import './style.scss'; In my webpack.dev.js, all I changed was an

Gulp, Vue, Webpack, Babel and Uncaught SyntaxError: Unexpected token import

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been trying whole day to get it to work without any luck so if someone could shine some light that would be very much appreciated. I'm trying to set up environment for working with ES6 files as well as Vue using Webpack. I've installed all dependencies, and created the following files: webpack.config.js module.exports = { entry: './resources/assets/source/js/app.js', output: { filename: 'app.js' }, devtool: 'source-map', resolve: { alias: { 'vue$': 'vue/dist/vue.js' } }, module: { loaders: [ { test: /\.js$/, loader: 'babel', exclude:

How to resolve the Webpack 2 loaderUtils.parseQuery() Warning?

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I compiled my files by using Webpack2. It showed the following warning: "loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56 " I checked the github page and did not find out how to resolve this problem. This is my config: // webpack 2 configuration // https://webpack.js.org/guides/migrating/ const webpack = require('webpack'); const path = require('path'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { watch: true,

Webpack module build failed unexpected token (rails react build)

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I working on a react/rails build and working through using webpack and babel for the first time. I'm using two files and getting the error : ERROR in ./app/assets/frontend/main.jsx Module build failed: SyntaxError: /Users/cls/GitHub/rails_react/app/assets/frontend/main.jsx: Unexpected token (6:6) Line 6 is: <Greet /> This is the main.jsx file import Greet from './greet'; class Main extends React.Component { render() { return ( <Greet /> ); } } let documentReady = () => { React.render( <Main />, document.getElementById('react') ); }; $

Server-side react with webpack 2 System.import

匿名 (未验证) 提交于 2019-12-03 08:42:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an isomorphic app that's using webpack 2 to compile assets. I added chunking now with System.import which works on the webpack side but not on the server-side with function not found. Any idea how I can solve this? 回答1: There are a few options available for getting System.import working with isomorphic/server-side rendering: Feature-detect System and polyfill Node allows you to call require() in a number of places and shimming System.import as follows should work: if (typeof System === "undefined") { var System = { import: function

How to use gulp webpack-stream to generate a proper named file?

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Currently we're using Webpack for our Module loader, and Gulp for everything else (sass -> css, and the dev/production build process) I want to wrap the webpack stuff into gulp, so all I have to do is type gulp and it starts, watches and runs webpack and the rest of what our gulp is setup to do. So I found webpack-stream and implemented it. gulp.task('webpack', function() { return gulp.src('entry.js') .pipe(webpack({ watch: true, module: { loaders: [ { test: /\.css$/, loader: 'style!css' }, ], }, })) .pipe(gulp.dest('dist/bundle.js')); });

How to load image files with webpack file-loader

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using webpack to manage a reactjs project. I want to load images in javascript by webpack file-loader . Below is the webpack.config.js : const webpack = require ( 'webpack' ); const path = require ( 'path' ); const NpmInstallPlugin = require ( 'npm-install-webpack-plugin' ); const PATHS = { react : path . join ( __dirname , 'node_modules/react/dist/react.min.js' ), app : path . join ( __dirname , 'src' ), build : path . join ( __dirname , './dist' ) }; module . exports = { entry : { jsx : './app/index.jsx' , }, output : { path

Webpack using bootstrap - jquery is not defined

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: import $ from 'jquery'; require("./node_modules/bootstrap/dist/css/bootstrap.min.css") require("./node_modules/bootstrap/js/dropdown.js") import React from 'react'; import ReactDOM from 'react-dom'; var _ = require('lodash'); Please refer above my setting . Some reason I've got error saying " Uncaught ReferenceError: jQuery is not defined() from dropdown.js I also included the following lines at webpack.config.js plugins: [ new webpack.NoErrorsPlugin({ $: "jquery", jQuery: "jquery" }) ] But, No luck - Still having jQuery undefined error. Any

Uncaught TypeError: fs.readFileSync is not a function

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to get webpack and mapbox-gl work together within Meteor system. I have look everywhere about the error mentioned above but none works. Here is my webpack setup { "root" : "src" , "devServer" : { "host" : "localhost" }, "sass" : { "module" : true }, "css" : { "module" : true }, "node" : { "fs" : "empty" }, "externals" : { "fs" : "{}" , "tls" : "{}" , "net" : "{}" , "console" : "{}" }, "module" : { "loaders" : [ { "test" : "/\\.js$/" , "include" : "./node_modules/mapbox-gl/js/render/painter/use_program.js" , "loader" :