webpack-2

Enabling webpack hot-reload in a docker application

故事扮演 提交于 2019-12-21 18:06:43
问题 I have a docker app with the following containers node - source code of the project. it serves up the html page situated in the public folder. webpack - watches files in the node container and updates the public folder (from the node container) on the event of change in the code. database this is the webpack/node container setup web: container_name: web build: . env_file: .env volumes: - .:/usr/src/app - node_modules:/usr/src/app/node_modules command: npm start environment: - NODE_ENV

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

只愿长相守 提交于 2019-12-21 17:53:27
问题 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

When do I use 'use' and 'loader' in Webpack 2 module.rules?

我的未来我决定 提交于 2019-12-20 16:15:14
问题 I am upgrading my current project to Webpack2 , which it was using Webpack1 prior. I have looked into a couple tutorials about upgrading and in general, I do understand. The issue I keep running into, though, is I'm not sure when to use 'use' and 'loader' in when specifying the module rules (loaders). At first, I thought use replaced loader . I understand this type of syntax: module: { rules: [{ test: /\.scss$/, use: [ { loader: 'postcss-loader', options: { plugins: ... } }, 'sass-loader' ] }

How to write Webpack plugin which adds modules to the bundle on the fly based on other modules?

爱⌒轻易说出口 提交于 2019-12-20 09:46:41
问题 I have a problem with writing a Webpack plugin for a translation service. The goal is to: Get names (and source code) of all required modules during compilation. I need to be able to scan the included source code for special t() function usage but I want to scan only those modules which will be included in the bundle (which, depending on build configuration, can be a subset of all project modules). Based on the gathered modules, I want to create additional modules (with translations) on the

Webpack There are multiple modules with names that only differ in casing

天大地大妈咪最大 提交于 2019-12-20 04:19:04
问题 I have something like this: WARNING in C:/Data/.../letsTest.jsx There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. Use equal casing. Compare these module identifiers: * C:\Data\...\node_modules\babel-loader\lib\index.js?presets[]=es2015&presets[]=react&presets[]=stage-0&presets[]=stage-2!C:\Data\...\letsTest.jsx Used by 4 module(s), i. e. multi C:/Data/Doc/13/13080801/LetsTest/letsTest

One project with multiple package.json files

余生颓废 提交于 2019-12-18 11:48:37
问题 I'm relatively new to modern JS development and I need help or advice about this situation I'm in. Situation: We have a React-Typescript-Redux project supporting IE8 (React 0.14). Now we're upgrading to IE11 and React 16 but IE8 should be supported. Requirement: Reduce project maintenance between browser versions by using different packages and/ or config files for each build. Problem: From research I made so far it seems impossible to use different package.json files and node_modules folders

ReferenceError: Can't find variable: Map

被刻印的时光 ゝ 提交于 2019-12-18 08:31:17
问题 I'm using Angular 4, Webpack 2.4.1, Karma 1.6 and Jasmine 2.6.1 and am writing ES2015 not TypeScript I've got a tiny angular demo app and I want to add unit tests. The demo app itself itself is working and Webpack is bundling everything correctly, but when I try to run the unit tests I see some errors in the console like this: ReferenceError: Can't find variable: Map at Static/js/app.welcome.js:2569 ( app.welcome.js is the name of my component) Webpack appears to be building my test bundle

Webpack 2: WARNING in .png, .svg, .. DEPRECATED. Configure optipng's optimizationLevel option in it's own options. (optipng.optimizationLevel)

二次信任 提交于 2019-12-18 05:55:38
问题 This WARNING is printed ~20 times when running webpack - it processes and bundles just fine, but what does it mean? How do I get rid of it? Googling around provides little to no help unfortunately. Here's my webpack config: const ExtractTextPlugin = require("extract-text-webpack-plugin"); var webpack = require("webpack"); module.exports = { entry: { dashboard: './js/main.js', vendor: ["fixed-data-table","react","react-dom","jquery", "bootstrap", "vis",], }, output: { path: "../public",

Webpack 2: WARNING in .png, .svg, .. DEPRECATED. Configure optipng's optimizationLevel option in it's own options. (optipng.optimizationLevel)

老子叫甜甜 提交于 2019-12-18 05:55:16
问题 This WARNING is printed ~20 times when running webpack - it processes and bundles just fine, but what does it mean? How do I get rid of it? Googling around provides little to no help unfortunately. Here's my webpack config: const ExtractTextPlugin = require("extract-text-webpack-plugin"); var webpack = require("webpack"); module.exports = { entry: { dashboard: './js/main.js', vendor: ["fixed-data-table","react","react-dom","jquery", "bootstrap", "vis",], }, output: { path: "../public",

Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type

你离开我真会死。 提交于 2019-12-17 22:56:08
问题 I am trying to import components from react-materialize as - import {Navbar, NavItem} from 'react-materialize'; But when the webpack is compining my .tsx it throws an error for the above as - ERROR in ./src/common/navbar.tsx (3,31): error TS7016: Could not find a declaration file for module 'react-materi alize'. 'D:\Private\Works\Typescript\QuickReact\node_modules\react-materialize\l ib\index.js' implicitly has an 'any' type. Any resolution for this .I'm unsure how to resolve this import