webpack中文

Using Webpack 2 and extract-text-webpack-plugin

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using extract-text-webpack-plugin 2.0.0-rc.3 with Webpack 2.2.1 and am getting this error when running the build: /node_modules/extract-text-webpack-plugin/index.js:259 var shouldExtract = !!(options.allChunks || chunk.isInitial()); ^ TypeError: chunk.isInitial is not a function Here is my webpack.config.js: 'use strict'; const argv = require('yargs').argv; const ExtractTextPlugin = require("extract-text-webpack-plugin"); const webpack = require('webpack'); module.exports = (function () { let config = { entry : './' + process.env.npm

webpack is not recognized as a internal or external command,operable program or batch file

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am Learning React.js and i am using windows 8 OS.i have navigate to my root folder 1.Created the package.json file by npm init 2. install webpack by npm install -S webpack.now webpack has been downloaded to my modules folder 3. install webpack globally by typing npm install webpack -g 4. i am also having a webpack.config.js in my root folder which contains the source and ouput directory 5. when i type the webpack command i am getting the below error. webpack is not recognized as a internal or external command,operable program or batch file

Why is my webpack bundle.js and vendor.bundle.js so incredibly big?

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: All my React projects tend to be incredibly large in file size (bundle.js is 4.87 mb and the vendor.bundle.js is 2,87 mb). I have no idea why it is this large. I already have uglifyJS on, but this doesn't seem to help a lot (5.09 > 4.87mb and 2.9 > 2.87mb) var webpack = require('webpack'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); require('es6-promise').polyfill(); var config = { entry: { app: [ './src/entry.jsx' ], vendor: [ 'react', 'lodash', 'superagent' ] }, output: { path: './build', filename: "bundle.js" }, eslint

Webpack style-loader vs css-loader

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two questions. 1) CSS Loader and Style Loader are two webpack loaders. I couldnt grasp the difference between the both. Why do I have to use two loaders when they both do the same job? 2) What is this .useable.less and .useable.css mentioned in the above Readme.md files? 回答1: The CSS loader takes a CSS file and returns the CSS with imports and url(...) resolved via webpack's require functionality: var css = require("css!./file.css"); // => returns css code from file.css, resolves imports and url(...) It doesn't actually do anything

Webpack babel 6 ES6 decorators

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've got a project written in ES6 with webpack as my bundler. Most of the transpiling works fine, but when I try to include decorators anywhere, I get this error: Decorators are not supported yet in 6.x pending proposal update . I've looked over the babel issue tracker, and haven't been able to find anything on it there, so I'm assuming I'm using it wrong. My webpack config (the relevant bits): loaders : [ { loader : 'babel' , exclude : /node_modules/ , include : path . join ( __dirname , 'src' ), test : /\.jsx?$/ , query : {

Node JS and Webpack Unexpected token <

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've started studing Node JS . So here is my files. index.html Hello app.js var http = require("http"), path = require('path') fs = require("fs"), colors = require('colors'), port = 3000; var Server = http.createServer(function(request, response) { var filename = path.join(__dirname, 'index.html'); fs.readFile(filename, function(err, file) { if(err) { response.writeHead(500, {"Content-Type": "text/plain"}); response.write(err + "\n"); response.end(); return; } response.writeHead(200); response.write(file); response.end(); }); }); Server

Cannot find module 'webpack/bin/config-yargs'

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Getting error when running webpack-dev-server --config config/webpack.dev.js --progress --profile --watch --content-base src/ . Here is the error log: module.js:442 throw err; ^ Error: Cannot find module 'webpack/bin/config-yargs' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad

Why isn't Webpack excluding a folder I specified?

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I keep my server & client code in the same repository, though I use Webpack to build only the client: My project builds fine if I delete the src/server folder. But when it's there I get all these Webpack Typescript duplicate definition errors like: [1m[31mERROR in /home/rje/projects/ekaya/typings/main/ambient/react-dom/index.d.ts (70,5): error TS2300: Duplicate identifier 'export='. which are caused by Webpack trying to build one of the files in my server folder that contains: /// <reference path="../../../../typings/main.d.ts" /> How can I

import CSS and JS files using Webpack

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a directory structure like this: and inside node_modules: >node_modules >./bin >webpack.config.js >bootstrap >bootstrap.css >bootstrap.js I need to generate separate CSS and JS bundles like this: custom-styles.css, custom-js.js, style-libs.css, js-libs.js where style-libs and js-libs should contain syles and js files of all libraries like bootstrap and jQuery. Here's what I have done so far: webpack.config.js: const path = require('path'); const basedir = path.join(__dirname, '../../client'); const HtmlWebpackPlugin = require('html

How to use blueimp-file-upload with webpack?

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using blueimp-file-upload in my website, and I'm using webpack to organize my js code. I installed blueimp-file-upload and jquery.ui.widget from NPM npm install --save blueimp-file-upload npm install --save jquery.ui.widget and I require blueimp-file-upload in my entry file require('blueimp-file-upload') but when I run webpack, I get thie error: ERROR in ./~/blueimp-file-upload/js/jquery.fileupload.js Module not found: Error: Cannot resolve module 'jquery.ui.widget' in E:\app-parent\cooka-common-web\src\main\resources\static\node_modules