var path = require('path')
var webpack = require('webpack')
const NODE_ENV = process.env.NODE_ENV || 'development';
const DEVMODE = NODE_ENV == 'development' ? 'development' : 'production';
//const ExtractTextPlugin = require("extract-text-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const devMode = process.env.NODE_ENV !== 'production'
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
let conf={
entry: './src/main.js',
output:{
path: path.resolve(__dirname,'../app/'),
publicPath: '/app/',
filename: 'app.js',
chunkFilename: '[name].[contenthash].js'
},
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader',
// 'postcss-loader',
'sass-loader',
],
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
// Since sass-loader (weirdly) has SCSS as its default parse mode, we map
// the "scss" and "sass" values for the lang attribute to the right configs here.
// other preprocessors should work out of the box, no loader config like this necessary.
'scss': [
'vue-style-loader',
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
],
'sass': [
'vue-style-loader',
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader?indentedSyntax'
]
}
// other vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: 'app.css', //devMode ? '[name].css' : '[name].[hash].css',
//chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
}),
new webpack.ProvidePlugin({
})
],
watchOptions: {
aggregateTimeout: 200
},
resolve: {
extensions: ['.js', '.vue', '.json'],
modules: [path.resolve(__dirname,"src"), 'node_modules'],
alias: {
'vue$': 'vue/dist/vue.common.js',
'muse-components': 'muse-ui/src'
}
},
};
module.exports = (env,options) => {
let production = options.mode === 'production';
conf.devtool = production
?
false
: "#cheap-module-source-map" ;
conf.watch = !production;
if(production){
conf.plugins.push(
new OptimizeCssAssetsPlugin({
})
)
}
console.log(conf)
return conf;
}
let PhoneInput = Vue.component('phone-input', function(resolve){require(['@core/inputs/PhoneInput.vue'],resolve)});
let MaterialInput = Vue.component('material-input', function(resolve){require(['@core/inputs/MaterialInput.vue'],resolve)});
let BaseInput = Vue.component('base-input', function(resolve){require(['@core/inputs/BaseInput.vue'],resolve)});
export default (type) => ({
components: {
PhoneInput,
CustomInput: type === 'material' ? MaterialInput : BaseInput
}
});
for (var i = +period.start; i < +period.end; i+= 3600000 * 168) {
dates.push(i);
}
for (var i = 0; i < date.length; i++) {
var date = new Date(dates[i]),
let period=[];
for (let dt = +period.start; dt < +period.end; dt+= 3600000 * 168) {
let date = new Date(dt),
period[i] = `${dateString1} - ${dateString2}`;
period.push(`${dateString1} - ${dateString2}`);