Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var webpack = require('webpack')
- var ExtractTextPlugin = require('extract-text-webpack-plugin')
- var path = require('path')
- module.exports = {
- context: path.join(__dirname, './static'),
- entry: './editor/index.js',
- output: {
- path: path.join(__dirname, './static/editor/bundle'),
- filename: 'bundle.js'
- },
- externals: {
- // require("jquery") is external and available
- // on the global var jQuery
- "jquery": 'jQuery' //название либы в package.json
- },
- module: {
- loaders: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- loaders: [
- 'react-hot',
- 'babel-loader'
- ]
- },
- {
- test: /\.css$/,
- loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
- },
- {
- test: /\.(png|jpg|svg|woff|woff2|eot|ttf)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
- loader: 'url-loader?limit=8192'
- }
- ]
- },
- resolve: {
- extensions: ['', '.js', '.jsx']
- },
- plugins: [
- new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
- new ExtractTextPlugin('style.css'),
- new webpack.DefinePlugin({
- 'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development') }
- })
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement