webpack中文

Webpack ProvidePlugin vs externals?

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm exploring the idea of using Webpack with Backbone.js . I've followed the quick start guide and has a general idea of how Webpack works, but I'm unclear on how to load dependency library like jquery / backbone / underscore. Should they be loaded externally with <script> or is this something Webpack can handle like RequireJS's shim? According to the webpack doc: shimming modules , ProvidePlugin and externals seem to be related to this (so is bundle! loader somewhere) but I cannot figure out when to use which. Thanks 回答1: It's both possible

“You may need an appropriate loader to handle this file type” with Webpack and Babel

匿名 (未验证) 提交于 2019-12-03 01:46:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use Webpack with Babel to compile ES6 assets, but I am getting the following error message: You may need an appropriate loader to handle this file type. | import React from 'react'; | /* | import { render } from 'react-dom' Here is what my Webpack config looks like: var path = require('path'); var webpack = require('webpack'); module.exports = { entry: './index', output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', publicPath: '/dist/' }, module: { loaders: [ { test: /\.jsx?$/, loader: 'babel-loader', exclude:

Webpack error from UglifyJS when creating production assets

匿名 (未验证) 提交于 2019-12-03 01:44:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Webpack Encore (similar to Webpack) to create asset files. Everything works well when creating the development files, however when running to command to generate the minified files for production I get an error. ERROR Failed to compile with 1 errors app.js from UglifyJS . Invalid assignment [app.js:131,42] Unexpected character '`' [app.js:10953,9] It seems like the issue is caused by two plugins: jquery-asScrollable and jquery-asScrollbar In fact commenting out the following lines, the process completes successfully require(

Webpack config error: configuration has an unknown property &#039;postcss&#039;

匿名 (未验证) 提交于 2019-12-03 01:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to build an angularjs application with webpack. But I can't do it because of the following error. Using the v2.1.0-beta.21 of webpack, I'm seeing this error. Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration has an unknown property 'postcss'. These properties are valid: object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?,

webpack bundle.js not found

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use webpack dev server, but can't access my bundle.js file. Edit: I am using this webpack config without bower-webpack-plugin . package.json { "name": "react_modules", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "npm run serve | npm run dev", "serve": "./node_modules/.bin/http-server -p 8080", "dev": "webpack-dev-server -d --progress --colors --port 8090" }, "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.0.20", "babel-loader": "^6.0.1", "babel-preset-es2015": "^6.0.15",

webpack: Cannot read property &#039;match&#039; of undefined

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have installed webpack (Symfony encore) using npm as follows: sudo npm install -g @symfony/webpack-encore --save-dev I ran this from /var/www/project I was required to install globally due to issues with package managers and shared folders when dealing with Windows host / Linux guest. I cannot install webpack (node_modules) in the same directory (or under it) as the /var/www/project So my package.json file looks like this: { "name": "test", "version": "1.0.0", "description": "This is a test", "main": "index.js", "dependencies": {},

Webpack: TypeError: Cannot read property &#039;properties&#039; of undefined

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here is the branch and repo in question: https://github.com/Futuratum/moon.holdings/tree/dev /Users/leongaban/projects/Futuratum/moon.holdings/node_modules/webpack-cli/bin/config-yargs.js:89 describe: optionsSchema.definitions.output.properties.path.description, Not sure why I'm getting this error, but I upgraded from Webpack 3 to 4. webpack /* eslint-disable no-console */ import webpack from 'webpack'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import ExtractTextPlugin from 'extract-text-webpack-plugin'; import CopyWebpackPlugin

Trace: The node type SpreadProperty has been renamed to SpreadElement at Object.isSpreadProperty

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm launching a react app, and here's my Webpack configuration: 'use strict' const ExtractPlugin = require('extract-text-webpack-plugin') const HTMLPlugin = require('html-webpack-plugin') module.exports = { devtool: 'eval', entry: `${__dirname}/src/main.js`, output: { filename: 'bundle-[hash].js', path: `${__dirname}/build`, publicPath: '/', }, mode: 'development', performance: { hints: false }, plugins: [ new HTMLPlugin(), new ExtractPlugin('bundle-[hash].css'), ], module: { rules: [ { test: /\.js$/, exclude: /node_module/, loader: 'babel

npx webpack - Cannot read property &#039;minify&#039; of undefined

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm following the basic tutorial of webpack from this link : https://webpack.js.org/guides/getting-started/ when I run npx webpack it fails with the following error: ERROR in main.js from Terser TypeError: Cannot read property 'minify' of undefined at minify (/Users/name/Documents/practice/webpack/webpack-demo/node_modules/terser-webpack-plugin/dist/minify.js:175:23) at module.exports (/Users/name/Documents/practice/webpack/webpack-demo/node_modules/terser-webpack-plugin/dist/worker.js:13:40) at handle (/Users/name/Documents/practice/webpack

React / Webpack - “Module parse failed: Unexpected token - You may need an appropriate loader to handle this file type.”

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to build a simple React app using Webpack, however during run time from the Webpack dev server I get the following error: > ERROR in ./client/components/home.js Module parse failed: Unexpected > token (8:3) You may need an appropriate loader to handle this file > type. | render(){ | return( | <h1>Hello World!</h1> | ) | } > @ ./client/app.js 13:12-43 @ multi > (webpack)-dev-server/client?http://localhost:8080 ./client/app.js Here is my Webpack.config.js file contents: var path = require('path'); var debug = process.env.NODE_ENV !