Advertisement
Guest User

Config_new

a guest
Feb 11th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var webpack = require('webpack')
  2. var ExtractTextPlugin = require('extract-text-webpack-plugin')
  3. var path = require('path')
  4.  
  5. module.exports = {
  6.   context: path.join(__dirname, './static'),
  7.   entry: './editor/index.js',
  8.   output: {
  9.     path: path.join(__dirname, './static/editor/bundle'),
  10.     filename: 'bundle.js'
  11.   },
  12.   externals: {
  13.     // require("jquery") is external and available
  14.     //  on the global var jQuery
  15.     "jquery": 'jQuery' //название либы в package.json
  16.   },
  17.   module: {
  18.     loaders: [
  19.       {
  20.         test: /\.js$/,
  21.         exclude: /node_modules/,
  22.         loaders: [
  23.           'react-hot',
  24.           'babel-loader'
  25.         ]
  26.       },
  27.       {
  28.         test: /\.css$/,
  29.         loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
  30.       },
  31.       {
  32.         test: /\.(png|jpg|svg|woff|woff2|eot|ttf)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
  33.         loader: 'url-loader?limit=8192'
  34.       }
  35.     ]
  36.   },
  37.   resolve: {
  38.     extensions: ['', '.js', '.jsx']
  39.   },
  40.   plugins: [
  41.     new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
  42.     new ExtractTextPlugin('style.css'),
  43.     new webpack.DefinePlugin({
  44.       'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development') }
  45.     })
  46.   ]
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement