webpack-2

Webpack2 Angular2 ng-bootstrap Tree Shaking

橙三吉。 提交于 2020-01-03 18:44:11
问题 I'm currently using https://github.com/ng-bootstrap/ng-bootstrap in my angular2 application and use webpack2 to build all ts files. i'm only using Modal Component from NgbModule for now, but in minified file i can still see NbgAccordian and other modules reference which is not used in my app @ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.15 i tried import { NgbModule, NgbModal, NgbModalOptions, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; but didn't worked as expected

Webpack2 Angular2 ng-bootstrap Tree Shaking

本秂侑毒 提交于 2020-01-03 18:44:06
问题 I'm currently using https://github.com/ng-bootstrap/ng-bootstrap in my angular2 application and use webpack2 to build all ts files. i'm only using Modal Component from NgbModule for now, but in minified file i can still see NbgAccordian and other modules reference which is not used in my app @ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.15 i tried import { NgbModule, NgbModal, NgbModalOptions, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; but didn't worked as expected

Webpack 2 issues with Semantic UI

孤者浪人 提交于 2020-01-02 07:19:27
问题 Been struggling to get semantic-ui setup using Webpack 2. I a few errors relating to the fonts in the default semantic-ui theme and another error regarding image-webpack-loader : ERROR in ./~/css-loader?{"lessPlugins":[{"options":{"paths":{"../../theme.config":"/Users/djthomps/Desktop/demo/theme.config"}}}]}!./~/less-loader!./semantic/src/semantic.less Module not found: Error: Can't resolve './themes/themes/default/assets/fonts/icons.eot' in '/Users/djthomps/Desktop/demo/semantic/src' @ ./~

Webpack config for Code splitting not working for production build

孤街醉人 提交于 2020-01-02 02:44:10
问题 Building a ReactJS application with Webpack. Recently interested in using code splitting to reduce app size. I've tried implementing a custom HOC that wrapped System.import(): /* async/index.tsx */ ... at a very high level looked like... class Async extends React ... { componentWillMount() { this.props.load.then(c => { this.component = c; this.setState({loaded:true}); } } render() { return this.component ? <this.component.default {...this.props} /> : <span />; } } /* async/foo/index.tsx */

Webpack 2: cannot resolve module

馋奶兔 提交于 2020-01-01 09:03:24
问题 I have a project like this: root/ webpack-config.js app/ app.js js/ dep.js core/ module.js Here is the webpack config file: module.exports = { entry: './app/app.js', output: { path: __dirname, filename: "[name]-bundle.js" }, module: { loaders: [ { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ } ] }, resolve: { modulesDirectories: ['core'] } ... in app.js, I have: import local_dep from './js/dep'; import myModule from 'module'; This works as expected with webpack 1.x, but the

Webpack 2: cannot resolve module

﹥>﹥吖頭↗ 提交于 2020-01-01 09:02:40
问题 I have a project like this: root/ webpack-config.js app/ app.js js/ dep.js core/ module.js Here is the webpack config file: module.exports = { entry: './app/app.js', output: { path: __dirname, filename: "[name]-bundle.js" }, module: { loaders: [ { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ } ] }, resolve: { modulesDirectories: ['core'] } ... in app.js, I have: import local_dep from './js/dep'; import myModule from 'module'; This works as expected with webpack 1.x, but the

Using webpack 2 from gulp (webpack-stream for webpack 2)?

北慕城南 提交于 2019-12-30 02:51:07
问题 I am trying to update to webpack 2. I use webpack-stream to run stuff from gulp, but it appears that webpack-stream is using it's own dependency on webpack which is webpack 1. I have not been able to find any webpack-stream with webpack 2. Is there any possibility to use webpack 2 from gulp? 回答1: You need to have both webpack and webpack-stream installed: npm install --save-dev webpack-stream npm install --save-dev webpack@2.1.0-beta.25 Then you can pass the webpack object as the second

Dynamically load modules with Webpack using Typescript

倾然丶 夕夏残阳落幕 提交于 2019-12-29 13:33:51
问题 I'm trying to build a web app which supports plugins, the environment is Angular 2 (so far), Typescript 2.1 and Webpack 2. I have some extension points (slots) where plugins can draw their content in: basically I have a component which is capable of hosting some other component known at runtime (see "Mastering Angular 2 Components" chapter 10 for the idea, and SO + plunker on how compile and "draw" at runtime an Angular component) Here's what I want to achieve: // in plugin.service.ts

Dynamically load modules with Webpack using Typescript

无人久伴 提交于 2019-12-29 13:33:48
问题 I'm trying to build a web app which supports plugins, the environment is Angular 2 (so far), Typescript 2.1 and Webpack 2. I have some extension points (slots) where plugins can draw their content in: basically I have a component which is capable of hosting some other component known at runtime (see "Mastering Angular 2 Components" chapter 10 for the idea, and SO + plunker on how compile and "draw" at runtime an Angular component) Here's what I want to achieve: // in plugin.service.ts

Dynamically load modules with Webpack using Typescript

为君一笑 提交于 2019-12-29 13:32:40
问题 I'm trying to build a web app which supports plugins, the environment is Angular 2 (so far), Typescript 2.1 and Webpack 2. I have some extension points (slots) where plugins can draw their content in: basically I have a component which is capable of hosting some other component known at runtime (see "Mastering Angular 2 Components" chapter 10 for the idea, and SO + plunker on how compile and "draw" at runtime an Angular component) Here's what I want to achieve: // in plugin.service.ts