Sha256: 8d1a79b1808097d57a0444a696e49b39d896eb13b416ccae4150658567799fbe

Contents?: true

Size: 1.95 KB

Versions: 5

Compression:

Stored size: 1.95 KB

Contents

var fs      = require('fs');
var path    = require('path');
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");

var buildEnv = process.env.BUILD_ENV || 'development';
var COMMONS = "commons";
var SCRIPTS = {
    data:     "./data.js",
    ui:       "./ui.js",
    widgets:  "./react-widgets.js",
    toggle:   "./react-toggle.js",
    calendar: "./calendar.js",
}

var ENTRIES = {};
for (key in SCRIPTS){
    ENTRIES[ key ] = SCRIPTS[key];
}
if (buildEnv === 'development') {
    ENTRIES['helpers'] = "./development.js";
}

module.exports = {
    cache: false,
    entry: ENTRIES,
    output: {
        path: path.join(__dirname, "../client/lanes/vendor/", buildEnv),
        filename: "[name].js"
    },
    resolve: {
        alias: {
            underscore: 'lodash',
            react: path.resolve('./node_modules/react'),
            'react-dom': path.resolve('./node_modules/react-dom')
        }
    },
    plugins: [
        new webpack.optimize.DedupePlugin(),
        new CommonsChunkPlugin({name: COMMONS, minChunks: 2}),
        new ExtractTextPlugin("../styles/[name].scss"),
        new webpack.DefinePlugin({
            'process.env': { 'NODE_ENV': JSON.stringify(buildEnv) }
        })
    ],
    module: {
        loaders: [
            { test: /\.gif$/, loader: "url-loader?mimetype=image/gif" },
            { test: /\.(png|woff|woff2|eot|ttf|svg)/, loader: "file-loader?name=[name].[ext]"  },
            { test: /\.less$/, loader: ExtractTextPlugin.extract("style-loader",
                                                                 "css-loader!less-loader") },
            { test: /\.scss$/, loader: ExtractTextPlugin.extract("raw-loader?name=[name].scss") },

            { test: /\.css$/,  loader: ExtractTextPlugin.extract("style-loader",
                                                                 "css-loader") }
        ]
    }
};

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lanes-0.7.0 npm-build/webpack.config.js
lanes-0.6.1 npm-build/webpack.config.js
lanes-0.6.0 npm-build/webpack.config.js
lanes-0.5.6 npm-build/webpack.config.js
lanes-0.5.5 npm-build/webpack.config.js