webpack-2

issue with webpack-server 2

浪子不回头ぞ 提交于 2019-12-12 01:52:24
问题 When i run webpack server, it redirects me to folders of project not my index.html, but if I open it without webpack server it works fine, and nothing in network tab. I think my webpack.config.js not loaded correctely! my webpack.confing.js : const ExtractTextPlugin = require("extract-text-webpack-plugin"); var path = require("path"); module.exports = { entry : './src/app.js', output : { path : path.resolve(__dirname,'dist'), filename : 'app.bundle.js' }, module : { rules : [ {test: /\.scss$/

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

*爱你&永不变心* 提交于 2019-12-11 17:49:50
问题 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

SyntaxError in Webpack / React.js Unexpected token = { } in React

大兔子大兔子 提交于 2019-12-11 16:54:11
问题 In one of my .js file, I'm getting the following error from Webpack: 4 | export default function(ComposedComponent) { 5 | class Authentication extends Component { > 6 | static contextTypes = { | ^ 7 | router: React.PropTypes.object 8 | } 9 | These are my devdependencies: "devDependencies": { "babel-core": "^6.17.0", "babel-loader": "^6.2.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.0", "babel-preset-react": "^6.16.0", "babel-preset-stage-3": "^6.24.1",

Webpack 2 sass-loader Unexpected character '@'

試著忘記壹切 提交于 2019-12-11 08:49:33
问题 i have the next webpack 2 rules configuration when run webpack throwed the next error: Unexpected character '@' (1:0) You may need an appropriate loader to handle this file type. | @media screen and (min-width: 40em) { | .feature { | margin-bottom: 8.75rem; @ ./~/style-loader?{"camelCase":true,"localIdentName":"[name]_[local]_[hash:base64:3]","modules":true}!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?{"sourceMap":true,"outputStyle":"expanded","include":["/opt/inmoblex/current

React CDN: Webpack externals library not resolved in code

梦想的初衷 提交于 2019-12-11 06:32:32
问题 I'm trying to load React through cdn on our production builds. We use React Universally, Heroku, Webpack 2, Material UI and React. In order to achieve this, we specify externals. However on our production frontend, I see Uncaught TypeError: Cannot read property 'Component' of undefined at Object.<anonymous> (Router.js:43) at t (bootstrap 967e68f…:19) at Object.<anonymous> (MemoryRouter.js:1) at t (bootstrap 967e68f…:19) at Object.<anonymous> (index-39d6020….js:8872) at t (bootstrap 967e68f…

Build this node project using only gulp or webpack

北城以北 提交于 2019-12-11 06:05:58
问题 My project has this folder structure: node | .gitignore | gulpfile.js | package.json | tsconfig.json | webpack.config.js | +---build | | debug.js | | main.js | | | +---client | | +---scripts | | | bundle.js | | | | | \---views | | index.html | | | | | \---server | | constants.js | | server.js | | | \---router | | constants.js | | router.js | | | \---routes | base.js | index.js | +---gulp | | constants.js | | | \---tasks | default.js | html.js | typescript.js | \---src | main.ts | +---client |

How to create/generate/export a file from my webpack 2 config to be used inside of my React code?

╄→гoц情女王★ 提交于 2019-12-11 05:44:44
问题 I am passing in NODE_ENV variables into my webpack.config from package.json in order to return an object that either contains API endpoints for localhost or production. 1) package.json "scripts": { "dev": "NODE_ENV=development webpack-dev-server --history-api-fallback", "prod": "NODE_ENV=production webpack -p", "build": "NODE_ENV=production webpack -p" } 2) endpoints.js function endpoints(env) { let prefix = env === 'development' ? 'http://localhost' : ''; return { "login": `${prefix}/app/api

Could not find Angular Material core theme

ぃ、小莉子 提交于 2019-12-11 03:55:23
问题 I have added angular material2 package to my project. However, I get the following warning message in browser i have created a custom scss file and imported the packages still it throw's warning message: Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: material.es5.js?7d89:180 https://material.angular.io/guide/theming I have created styles.scss file and included following configuration file Package "

SyntaxError: Unexpected token with Jasmine

走远了吗. 提交于 2019-12-11 02:57:03
问题 I'm using the latest node and running jasmine tests on my project only to be met with jasmine-node spec Exception loading: /usr/src/app/spec/playground/playground.spec.js /usr/src/app/src/engine/playground.Soundcloud.js:1 (function (exports, require, module, __filename, __dirname) { import PLAYGROUND from 'playground.js' SyntaxError: Unexpected token import my package.json is { "main": "index.js", "scripts": { "server-server": "nodemon index.js", "dev" : "", "test": "jasmine-node spec", "dev

WebPack loads all semantic-ui components

浪尽此生 提交于 2019-12-11 02:38:47
问题 I'm currently working on a project and i need to configure WebPack . In the project, we are also using ReactJS and Semantic-UI . Here is webpack.config.js : var path = require("path"); var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var BundleAnalyzer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = { context: __dirname, entry: { react: ["react", "react-dom"], home: './assets/js/index.jsx', }, output: { path: path.resolve('.