Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{ test: /\.json$/, loader: 'json-loader' }
]
},
plugins: [
new webpack.DefinePlugin({
'Meteor.isClient': true,
'Meteor.isServer': false
}),
new webpack.PrefetchPlugin("react"),
new webpack.PrefetchPlugin("react/lib/ReactComponentBrowserEnvironment")
]
});
////////////////////////////////////////////////////////////////////////////////
// CLIENT DEVELOPMENT
////////////////////////////////////////////////////////////////////////////////
if (mode === 'dev') {
config = merge.smart({
entry: [
'webpack-dev-server/client?' + baseUrl,
'webpack/hot/only-dev-server'
],
plugins: [
new webpack.HotModuleReplacementPlugin(),
"ts|tsx": {
loaders: ['react-hot', 'ts-loader']
}
};
var stylesheetLoaders = {
"css": 'css-loader'
};
var publicPath = options.development
? "http://localhost:2992/_assets/"
: "/_assets/";
if (options.development) {
var plugins = [
new webpack.PrefetchPlugin("react"),
{
apply: function (compiler) {
compiler.plugin('after-emit', function (compilation, done) {
var stats = compilation.getStats().toJson({
// node_modules/webpack/lib/Stats.js
hash: true,
version: true,
timings: false,
assets: true,
chunks: false,
chunkModules: false,
chunkOrigins: false,
modules: false,
cached: false,
reasons: false,
children: false,
let suffix = '',
outputPath = path.join(root_dir, 'build');
let processVars = {
'process.env':{}
};
// PRODUCTION CASE
if (prod) {
// WRAP INTO CSS FILE
cssLoaders = extractForProduction(cssLoaders);
sassLoaders = extractForProduction(sassLoaders);
scssLoaders = extractForProduction(scssLoaders);
suffix = '-prod';
plugins.push(new webpack.PrefetchPlugin("react"));
plugins.push(new ExtractTextPlugin("app-[hash].css"));
processVars['process.env'].NODE_ENV = JSON.stringify('production');
outputPath = path.join(root_dir, 'dist');
}
// HTML TEMPLATE + ENV VARIABLE
if (client) {
suffix = !devserver ? suffix : '-dev';
processVars['process.env'].BROWSER = JSON.stringify(true);
plugins.push(new Clean(cleanDirectories, root_dir));
plugins.push(new webpack.DefinePlugin(processVars));
plugins.push(new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'));
plugins.push(new webpack.optimize.DedupePlugin());
plugins.push(new webpack.optimize.OccurenceOrderPlugin(true));
if (prod) {
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel?stage=0',
exclude: /node_modules|react-runtime\.js/,
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
],
},
plugins: [
new webpack.PrefetchPlugin("react/addons"),
new webpack.PrefetchPlugin("react"),
new webpack.PrefetchPlugin("react/lib/ReactComponentBrowserEnvironment"),
new webpack.optimize.CommonsChunkPlugin('react', 'react.bundle.js'),
]
};
loaders: [
{
test: /\.jsx?$/,
loader: 'babel?stage=0',
exclude: /node_modules|react-runtime\.js/,
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
],
},
plugins: [
new webpack.PrefetchPlugin("react/addons"),
new webpack.PrefetchPlugin("react"),
new webpack.PrefetchPlugin("react/lib/ReactComponentBrowserEnvironment"),
new webpack.optimize.CommonsChunkPlugin('react', 'react.bundle.js'),
]
};
"/_assets/";
var output = {
path: path.join(__dirname, "build", options.prerender ? "prerender" : "public"),
publicPath: publicPath,
filename: "[name].js" + (options.longTermCaching && !options.prerender ? "?[chunkhash]" : ""),
chunkFilename: (options.devServer ? "[id].js" : "[name].js") + (options.longTermCaching && !options.prerender ? "?[chunkhash]" : ""),
sourceMapFilename: "debugging/[file].map",
libraryTarget: options.prerender ? "commonjs2" : undefined,
pathinfo: options.debug || options.prerender
};
var excludeFromStats = [
/node_modules[\\\/]react(-router)?[\\\/]/,
/node_modules[\\\/]items-store[\\\/]/
];
var plugins = [
new webpack.PrefetchPlugin("react"),
new webpack.PrefetchPlugin("react/lib/ReactComponentBrowserEnvironment")
];
if(options.prerender) {
plugins.push(new StatsPlugin(path.join(__dirname, "build", "stats.prerender.json"), {
chunkModules: true,
exclude: excludeFromStats
}));
aliasLoader["react-proxy$"] = "react-proxy/unavailable";
aliasLoader["react-proxy-loader$"] = "react-proxy-loader/unavailable";
externals.push(
/^react(\/.*)?$/,
/^reflux(\/.*)?$/,
"superagent",
"async"
);
plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }));
'utils' : 'modules/utils'
}
},
context: __dirname,
entry: {
'global-ui': ['molgenis-global-ui-webpack'],
'global': ['molgenis-global-webpack'],
'vendor-bundle': ['molgenis-vendor-webpack']
},
output: {
path : '../../../target/classes/js/dist',
filename: 'molgenis-[name].js',
publicPath: '/js/dist/'
},
plugins: [
new webpack.PrefetchPlugin('react/lib/ReactWithAddons'),
new webpack.PrefetchPlugin('react/lib/DOMChildrenOperations.js'),
new webpack.PrefetchPlugin('react/lib/ReactDOMComponent'),
new webpack.PrefetchPlugin('react/lib/ReactReconcileTransaction'),
new webpack.PrefetchPlugin('react/lib/React'),
new webpack.PrefetchPlugin('react-components'),
new webpack.PrefetchPlugin('moment'),
new webpack.PrefetchPlugin('promise'),
new webpack.PrefetchPlugin('./src/modules/react-components/wrapper/JQRangeSlider.js'),
new webpack.ProvidePlugin({$: "jquery", jQuery: "jquery"}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
: "/dist/";
var output = {
path: projectRoot + "/dist/",
filename: "bundle.js",
publicPath: publicPath,
contentBase: projectRoot + "/public/",
libraryTarget: "commonjs2"
};
var excludeFromStats = [
/node_modules[\\\/]react(-router)?[\\\/]/
];
var plugins = [
new webpack.PrefetchPlugin( "react" ),
new webpack.PrefetchPlugin( "react/lib/ReactComponentBrowserEnvironment" ),
new webpack.ProvidePlugin( { $: "jquery", jQuery: "jquery" } )
];
if ( opts.prerender ) {
plugins.push( new StatsPlugin( path.join( projectRoot, "dist", "stats.prerender.json" ), {
chunkModules: true,
exclude: excludeFromStats
} ) );
aliasLoader["react-proxy$"] = "react-proxy/unavailable";
aliasLoader["react-proxy-loader$"] = "react-proxy-loader/unavailable";
externals.push(
/^react(\/.*)?$/,
/^reflux(\/.*)?$/,
"superagent",
"async"
var output = {
path: projectRoot + '/dist/',
filename: 'bundle.js',
publicPath: publicPath,
contentBase: projectRoot + '/public/',
libraryTarget: 'commonjs2'
};
var excludeFromStats = [
/node_modules[\\\/]react(-router)?[\\\/]/
];
var plugins = [
new webpack.PrefetchPlugin('react'),
new webpack.PrefetchPlugin('react-dom/lib/ReactComponentBrowserEnvironment')
];
if (opts.prerender) {
plugins.push(new StatsPlugin(path.join(projectRoot, 'dist', 'stats.prerender.json'), {
chunkModules: true,
exclude: excludeFromStats
}));
aliasLoader['react-proxy$'] = 'react-proxy/unavailable';
aliasLoader['react-proxy-loader$'] = 'react-proxy-loader/unavailable';
externals.push(
/^react(\/.*)?$/,
/^reflux(\/.*)?$/,
'superagent',
'async'
);
plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }));
const prefetchPlugins = prefetches.map(specifier => new webpack.PrefetchPlugin(specifier));