by
3 7
0
3
255
0
Top 10% !
Popular
Specified
Popularity: 1730181st place
No tags for this snippet yet.
LanguageJavaScript
SourceGitHub

Development webpack config - http://stackoverflow.com/questions/41420329/consuming-pure-es2015-libraries-with-webpack-2

Development webpack config - http://stackoverflow.com/questions/41420329/consuming-pure-es2015-libraries-with-webpack-2: 
webpack.config.js
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1610496/Development-webpack-config---http---stac?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
const config = { devtool: 'source-map', devServer: { port: 3808, headers: { 'Access-Control-Allow-Origin': '*' } }, context: '/Users/kross/projects/af/spec/dummy', entry: { application: [ 'react-hot-loader/patch', 'webpack-dev-server/client?http://localhost:3808', 'webpack/hot/only-dev-server', './ui/src/index.js' ], vendor: [ '@alienfast/material-ui', 'classnames', 'cookie', 'core-js', 'dom-helpers', 'dompurify', 'es-collections', 'fbemitter', 'graphql', 'graphql-relay', 'i18next', 'i18next-browser-languagedetector', 'i18next-localstorage-cache', 'i18next-sprintf-postprocessor', 'jwt-decode', 'jss', 'jss-camel-case', 'jss-compose', 'jss-default-unit', 'jss-expand', 'jss-global', 'jss-nested', 'jss-preset-default', 'jss-props-sort', 'jss-theme-reactor', 'key.js', 'lodash', 'material-ui', 'md5', 'query-string', 'react', 'react-dom', 'react-formal', 'react-helmet', 'react-i18next', 'react-relay', 'react-relay-network-layer', 'react-router', 'react-router-relay', 'react-sizeme', 'react-tap-event-plugin', 'recompose', 'ua-parser-js', 'whatwg-fetch', 'yup' ] }, output: { path: '/Users/kross/projects/af/spec/dummy/public/webpack', publicPath: '//localhost:3808/webpack/', filename: '[name].js' }, resolve: { extensions: [ '.js', '.jsx', '.json' ], alias: { react: '/Users/kross/projects/af/spec/dummy/node_modules/react', 'react-relay': '/Users/kross/projects/af/spec/dummy/node_modules/react-relay' } }, module: { loaders: [ { test: /\.jsx?$/, include: [ '/Users/kross/projects/af/spec/dummy/ui/src', '/Users/kross/projects/af/spec/dummy/ui/tests', '/Users/kross/projects/af/spec/dummy/node_modules/react', '/Users/kross/projects/af/spec/dummy/node_modules/react-relay' ], exclude: /node_modules\/(?!(react|react-relay)\/).*/, loaders: [ 'happypack/loader' ] }, { test: /\.json$/, loader: 'json-loader' }, { test: /\.svg(\?.*)?$/, loader: 'url-loader?prefix=fonts/&name=[path][name].[ext]&limit=10000&mimetype=image/svg+xml' }, { test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' } ] }, plugins: [ new HappyPack({ loaders: [ 'babel-loader' ] }), new webpack.DefinePlugin({ NODE_ENV: 'development', __DEV__: true, __PROD__: false, __TEST__: false, ENV: 'development', 'process.env': { NODE_ENV: '"development"' } }), new StatsPlugin('manifest.json', { // We only need assetsByChunkName chunkModules: false, source: false, chunks: false, modules: false, assets: true }), new webpack.NoErrorsPlugin(), new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 15 }), new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 10000 }), new webpack.optimize.CommonsChunkPlugin({ names: [ 'vendor', 'manifest' ] // Specify the common bundle's name. }) ] }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus