Tag: webpack

Webpack不能在Linux上安装

最近我改变我的环境从Windows 10到backbox Linux 4.5.1,但我已经尝试安装使用npm多次的webpack。 它永远不会安装它给出这些错误。 任何帮助? verbose tar unpack /home/dove/.npm/webpack/1.12.13/package.tgz 34 silly lockFile 27155615-tar-usr-lib-node-modules-webpack tar:///usr/lib/node_modules/webpack 35 verbose lock tar:///usr/lib/node_modules/webpack /home/dove/.npm/27155615-tar-usr-lib-node-modules-webpack.lock 36 silly lockFile 5c48f9fd–npm-webpack-1-12-13-package-tgz tar:///home/dove/.npm/webpack/1.12.13/package.tgz 37 verbose lock tar:///home/dove/.npm/webpack/1.12.13/package.tgz /home/dove/.npm/5c48f9fd–npm-webpack-1-12-13-package-tgz.lock 38 silly gunzTarPerm modes [ '775', '664' ] 39 error Error: EACCES, mkdir '/usr/lib/node_modules/webpack' 39 error { [Error: EACCES, mkdir '/usr/lib/node_modules/webpack'] 39 error errno: 3, […]

npm与巴贝尔和webpack创build反应应用程序不起作用

我是新兴的UI技术。 我正在尝试我的手在reactjs随着webpack和babel我创build了一个应用程序后使用npm安装它使用create-react-app插件。 我进入src文件夹并执行npm start,启动浏览器并显示演示页面。 我试图添加babel和webpack到这个演示,但不幸的是它不工作。 我打开浏览器中的index.html页面,它不显示我所遵循的jsx文件内容https://www.codementor.io/tamizhvendan/beginner-guide-setup-reactjs-environment-npm-babel-6-的WebPack-du107r9zr 我不知道为什么这不起作用,可以请一些帮助吗? index.jsx import React from 'react'; import {render} from 'react-dom'; class App extends React.Component { render () { return <p> Hello React!</p>; } } render(<App/>, document.getElementById('app')); 的index.html <html> <head> <meta charset="utf-8"> <title>React.js using NPM, Babel6 and Webpack</title> </head> <body> <div id="app" /> <script src="public/bundle.js" type="text/javascript"></script> </body> </html> .babelrc文件 { […]

在Webpack中使用节点通告器

我编写了一个用create-react-app(我使用Webpack和Babel)创build的Electron项目。 我想使用节点通知符,但是我在configurationWebpack时遇到了问题(我认为)。 通知调用的代码是从repo的自述文件复制粘贴。 我目前的Webpackconfiguration(我设法取消所以没有错误)是: node: { fs: 'empty', net: 'empty', tls: 'empty', child_process: 'mock', __filename: true, __dirname: true }, externals: [ 'ws' ], target: 'electron' 有没有人有一个如何configuration的想法? 我做错了什么,没有通知显示?

不是来自webpack的内容是从/ dist提供的

webpack.config.js var HtmlWebpackPlugin = require('html-webpack-plugin'); const path = require('path'); module.exports = { entry:'./src/app.js', output:{ path:path.join(__dirname, 'dist'), filename:'app.bundle.js', publicPath:'/dist/' }, , devServer: { contentBase: path.join(__dirname, "dist"), compress: true, stats: "errors-only", openPage: '', port:9000, open:true }, plugins: [new HtmlWebpackPlugin({ title:'Forum', filename:'index.html' //template:'./src/app.html' })] } 我的项目结构: ├── forum │ └── dist └── app.bundle.js ├── src │ ├── app.html […]

在Google Cloud App Engine中安装开发依赖关系

我正在尝试将我的React应用部署到Google Cloud App引擎。 我也添加了一个app.yaml文件。 它看起来像这样: // app.yaml runtime: nodejs env: flex 现在,我想在部署之前使用webpack构build我的项目。 所以下面的文档 ,我已经添加了prestart脚本到package.json 。 现在我的脚本部分package.json看起来像这样: "scripts": { "build": "npm-run-all –parallel webpack-client-build webpack-server-build", "webpack-server-build": "NODE_ENV='development' webpack –config ./webpack/webpack.server.config.js –progress –colors –watch", "webpack-client-build": "NODE_ENV='development' webpack –config ./webpack/webpack.browser.config.js –progress –colors –watch", "build-prod": "npm-run-all webpack-client-build-prod webpack-server-build-prod", "webpack-server-build-prod": "webpack –config ./webpack/webpack.server.config.js -p", "webpack-client-build-prod": "webpack –config ./webpack/webpack.browser.config.js -p", "prestart": "npm […]

无法在AWS EC2的公共IP上使用webpackdevserver托pipe反应应用程序

我正在运行AWS EC2上的react应用程序,它通过localhost:3000访问时在本地工作 我想让它公共访问,所以我通过公共ip到以下命令 var webpackDevServer = new WebpackDevServer(bundler, { publicPath: '/', hot: false, quiet: false, noInfo: true, stats: { colors: true } }); webpackDevServer.listen(3000, '18.230.124.435', function () { console.log('Bundling project, please wait…'); }); 我正在使用gulp来运行任务。 我geting一个错误错误:听EADDRNOTAVAIL 18.230.124.435:3000 我在这里做错了什么?

Npm包提供一个Material-UI HOC到一个Nextjs应用程序

问题描述 我正在尝试通过npm包提供Material-UI到Nextjs应用程序。 npm包使用Webpack。 这一切正常,但我得到一个错误消息。 这个东西稍微超出了我对npm packages&webpack的理解,我可能不会这样做,如果是这样的话,请提供build议。 错误消息 警告:上下文types失败: 64a55d578f856d258dc345b094a2a2b3types的上下文64a55d578f856d258dc345b094a2a2b3提供给withStyles(ButtonBase) , Jss预期实例。 警告:上下文types失败:提供给withStyles(TouchRipple)types的SheetsRegistrytypes的无效上下文d4bd0baacbc52bbd48bbb9eb24344ecd ,为withStyles(TouchRipple)预期实例。 重现步骤 这只会让你检查错误。 git clone https://github.com/astenmies/next-library-starter.git && cd next-library-starter && yarn && yarn run dev 调整npm包的步骤 这将让你检查错误,并调整本地运行的npm包。 首先得到npm包并运行它 git clone https://github.com/astenmies/next.js-library.git && cd next.js-library && yarn && yarn run dev 然后在你的terminal的另一个选项卡上,在上述相同的根目录下…获取nextjs应用程序,删除npm包,获取linklocal并运行应用程序。 git clone https://github.com/astenmies/next-library-starter.git && cd next-library-starter && yarn remove next-library && yarn […]

无服务器框架中的webpackconfiguration中的多个入口点

我正在开发使用无服务器框架的无服务器应用程序。 我需要webpack编译根文件夹内的.js文件以及'src'文件夹。 configuration文件和“src”文件夹就在根文件夹中。 这是webpack.config.js文件 var glob = require('glob'); var path = require('path'); var nodeExternals = require('webpack-node-externals'); // Required for Create React App Babel transform process.env.NODE_ENV = 'production'; module.exports = { // Use all js files in project root (except // the webpack config) as an entry entry: globEntries('!(webpack.config).js'), target: 'node', // Since 'aws-sdk' is not […]

SourceMapDevToolPlugin在webpack中运行得很好。 它不接pipedevtool工作

当我设置devtool:'source-map'并应用SourceMapDevToolPlugin时 ,SourceMapDevToolPlugin不会接pipedevtool选项并生成两个不同的源地图。 webpack.config.js: const path = require('path'); const webpack = require('webpack'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); var config = { context: path.resolve( __dirname, 'src'), entry:{ test1: 'test.js' }, output: { filename: 'js/[name].js?=[chunkhash]', path: path.resolve( __dirname, 'dist'), devtoolModuleFilenameTemplate: '[absolute-resource-path]', sourceMapFilename: 'srcMap/[file].map' }, module: { rules: [ { test: /\.jsx?$/, exclude: /node_modules/, use: [ […]

不能NPM当需要在test / index.js中需要selenium-webdriver的testing时启动

所以我正在尝试使用webpack和selenium-webdriver在JavaScript项目上进行testing。 但是,当我需要从test / index.js文件的testing文件,以便在浏览器中运行它们npm开始崩溃与一系列'无法解决模块'错误。 我所需testing的标题如下所示: //=> test/meal_test.js const assert = require('chai').assert; const webdriver = require('selenium-webdriver'); const Meal = require("../lib/meal.js") const until = webdriver.until; const frontEndLocation = "http://localhost:8080" describe('test meal object', function() { it('should meal info and food info', function() { const meal = new Meal({ "id": 1, "name": "Breakfast", "foods": [ { "id": 4, "name": […]