forked from community/device-mgt-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
3.5 KiB
120 lines
3.5 KiB
7 years ago
|
/*
|
||
|
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||
|
*
|
||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||
|
* Version 2.0 (the "License"); you may not use this file except
|
||
|
* in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing,
|
||
|
* software distributed under the License is distributed on an
|
||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
|
* KIND, either express or implied. See the License for the
|
||
|
* specific language governing permissions and limitations
|
||
|
* under the License.
|
||
|
*/
|
||
7 years ago
|
var path = require('path');
|
||
6 years ago
|
const HtmlWebPackPlugin = require("html-webpack-plugin");
|
||
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||
7 years ago
|
|
||
|
const config = {
|
||
|
devtool: "source-map",
|
||
|
watch: false,
|
||
6 years ago
|
resolve: {
|
||
|
alias: {
|
||
|
AppData: path.resolve(__dirname, 'source/src/app/common/'),
|
||
|
AppComponents: path.resolve(__dirname, 'source/src/app/components/')
|
||
|
},
|
||
|
extensions: ['.jsx', '.js', '.ttf', '.woff', '.woff2', '.svg']
|
||
|
},
|
||
7 years ago
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.(js|jsx)$/,
|
||
|
exclude: /node_modules/,
|
||
|
use: [
|
||
|
{
|
||
6 years ago
|
loader: 'babel-loader'
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
test: /\.html$/,
|
||
|
use: [
|
||
|
{
|
||
|
loader: "html-loader",
|
||
|
options: { minimize: true }
|
||
7 years ago
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
test: /\.css$/,
|
||
6 years ago
|
use: [MiniCssExtractPlugin.loader, "css-loader"]
|
||
|
},
|
||
|
{
|
||
|
test: /\.scss$/,
|
||
|
use: [
|
||
|
MiniCssExtractPlugin.loader,
|
||
|
"css-loader",
|
||
|
"postcss-loader",
|
||
|
"sass-loader"
|
||
|
]
|
||
7 years ago
|
},
|
||
7 years ago
|
{
|
||
|
test: /\.scss$/,
|
||
|
use: [ 'style-loader', 'scss-loader' ]
|
||
|
},
|
||
7 years ago
|
{
|
||
|
test: /\.less$/,
|
||
|
use: [{
|
||
|
loader: "style-loader" // creates style nodes from JS strings
|
||
|
}, {
|
||
|
loader: "css-loader" // translates CSS into CommonJS
|
||
|
}, {
|
||
|
loader: "less-loader" // compiles Less to CSS
|
||
|
}]
|
||
6 years ago
|
},
|
||
|
{
|
||
|
test: /\.(woff|woff2|eot|ttf|svg)$/,
|
||
|
loader: 'url-loader?limit=100000',
|
||
|
},
|
||
|
{
|
||
|
test: /\.(png|jpe?g)/i,
|
||
|
use: [
|
||
|
{
|
||
|
loader: "url-loader",
|
||
|
options: {
|
||
|
name: "./img/[name].[ext]",
|
||
|
limit: 10000
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
loader: "img-loader"
|
||
|
}
|
||
|
]
|
||
7 years ago
|
}
|
||
|
]
|
||
7 years ago
|
},
|
||
6 years ago
|
plugins: [
|
||
|
new HtmlWebPackPlugin({
|
||
|
template: "./src/index.html",
|
||
|
filename: "./index.html"
|
||
|
}),
|
||
|
new MiniCssExtractPlugin({
|
||
|
filename: "[name].css",
|
||
|
chunkFilename: "[id].css"
|
||
|
})
|
||
|
],
|
||
|
externals: {
|
||
|
'Config': JSON.stringify(require('./public/conf/config.json'))
|
||
7 years ago
|
}
|
||
|
};
|
||
|
|
||
|
if (process.env.NODE_ENV === "development") {
|
||
|
config.watch = true;
|
||
|
}
|
||
|
|
||
|
module.exports = config;
|