var path = require('path');
module.exports = {
entry: './entry.js',
output: {
filename: 'testApp/www/index.js'
},
resolve: {
extensions: ['.js', '.jsx', '.json']
},
module: {
loaders: [
{ test: /\.jsx?$/,
loader: 'babel-loader',
include: path.resolve(__dirname, "app"),
query:
{
presets:['react', 'es2015', 'stage-0']
}
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
}
]
}
};
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
'./src/index'
],
output: {
path: path.join(__dirname, 'production/public/'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new ExtractTextPlugin({
filename: 'style.css',
disable: false,
allChunks: false, // true
})
],
module: {
rules: [
{
test: /\.js$/,
loaders: ['babel-loader'],
include: path.join(__dirname, 'src'),
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: ['css-loader', 'postcss-loader'],
publicPath: '/public',
}),
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: ['css-loader', 'postcss-loader', 'sass-loader'],
publicPath: '/public',
}),
},
....
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
'./src/index'
],
output: {
path: path.join(__dirname, 'production/public/'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new ExtractTextPlugin('style.css', {
allChunks: false
})
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.scss$/,
include: path.join(__dirname, 'src'),
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader')
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
...
const ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ExtendPlugin = require('extended-define-webpack-plugin');
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
'./entry.js'
],
output: {
path: path.join(__dirname, 'production/public/'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new ExtendPlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new ExtractTextPlugin({
filename: '/testApp/www/style.css',
disable: false,
allChunks: false, // true
})
],
module: {
rules: [
{
test: /\.jsx?$/,
loaders: ['babel-loader'],
include: path.join(__dirname, 'src'),
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: ['style-loader','css-loader','sass-loader'],
publicPath: '/public',
}),
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: ['style-loader','css-loader','sass-loader'],
publicPath: '/public',
}),
}
]
}
};