JSFiddle - React, Tailwind, and code Playground
by chikunova_nata
JavaScript
require('babel-polyfill');
var fs = require('fs');
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlPlugin = require('html-webpack-plugin');
var ProgressPlugin = require('webpack/lib/ProgressPlugin');
var nodeModulesPath = path.resolve(__dirname, 'node_modules');
var mainPath = path.resolve(__dirname, 'src', 'main.js');
var publicPath = path.resolve(__dirname, 'public');
var config = {
devtool: 'cheap-module-eval-source-map',
devServer: {
port: 3000,
info: false,
historyApiFallback: true,
host: 'localhost',
hot: true
},
progress: true,
entry: {
main: [
// configuration for babel6
'babel-polyfill',
//'webpack-dev-server/client?http://localhost:8080',
//'webpack-hot-middleware/client?http://localhost.target.com:3000/__webpack_hmr',
// example for single entry point. Multiple Entry bundle example will be added later
'./src/index.js'
]
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'public'),
publicPath: '/public/'
},
resolve: {
modulesDirectories: ['bower_components', 'node_modules']
},
module: {
preLoaders: [{
// test: /\.jsx$|\.js$/,
// loader: 'eslint-loader',
// include: __dirname + '/src/'
//}],
//loaders: [{
// test: /\.jsx?$/,
// include: path.join(__dirname, 'src'),
// loader: "babel-loader",
// exclude: [nodeModulesPath]
//}, {
test: /\.js$/,
exclude: /node_modules|bower_components/,
loaders: ['ng-annotate', 'babel']
},{
test: /\.less$/,
include: path.join(__dirname, 'src'),
loader: ExtractTextPlugin.extract('style-loader', 'css!autoprefixer-loader?browsers=last 2 version!less')
}, {
test: /\.html$/,
exclude: /node_modules|bower_components/,
loaders: ['raw']
}]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
...