"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var webpack_1 = __importDefault(require("webpack"));
var webpack_merge_1 = __importDefault(require("webpack-merge"));
var html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
var base_config_1 = require("./base.config");
var dic_1 = require("../util/dic");
var mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
var util_1 = require("../util");
var version = require(dic_1.ROOT_PACKAGE_PATH('package.json')).version;
var MarkDownToVue = require('@nutui/markdown-to-vue');
exports.devConfig = webpack_merge_1.default(base_config_1.baseConfig, {
    mode: 'development',
    entry: {
        'nutui-mobile': dic_1.ROOT_CLI_PATH('site/demo/app.js'),
        'nutui-doc': dic_1.ROOT_CLI_PATH('site/doc/app.js')
    },
    output: {
        filename: '[name].bundle.js',
        chunkFilename: '[name].chunk.js'
    },
    optimization: {
        splitChunks: {
            cacheGroups: {
                chunks: {
                    chunks: 'all',
                    minChunks: 2,
                    minSize: 0,
                    name: 'common_chunks'
                }
            }
        }
    },
    plugins: [
        // doc
        new MarkDownToVue({
            entry: dic_1.ROOT_PACKAGE_PATH('src'),
            output: dic_1.ROOT_CLI_PATH('site/doc/view/'),
            template: './doc-site/template.html',
            nav: 'left',
            needCode: true,
            isbuild: util_1.isDev(),
            hasMarkList: false,
            version: version
        }),
        new MarkDownToVue({
            entry: dic_1.ROOT_PACKAGE_PATH('docs'),
            output: dic_1.ROOT_CLI_PATH('site/doc/page/'),
            template: './doc-site/template.html',
            nav: 'left',
            needCode: false,
            isbuild: util_1.isDev(),
            version: version
        }),
        new mini_css_extract_plugin_1.default({
            filename: util_1.isDev() ? '[name].css' : 'css/[name].[hash].min.css'
        }),
        new html_webpack_plugin_1.default({
            template: dic_1.ROOT_CLI_PATH('site/doc/index.html'),
            filename: 'default.html',
            hash: true,
            inject: true,
            chunks: ['common_chunks', 'nutui-doc'],
            minify: {
                minifyJS: true,
                minifyCSS: true,
                removeAttributeQuotes: true //压缩 去掉引号
            }
        }),
        new html_webpack_plugin_1.default({
            template: dic_1.ROOT_CLI_PATH('site/demo/index.html'),
            filename: 'demo.html',
            hash: true,
            inject: true,
            chunks: ['common_chunks', 'nutui-mobile'],
            minify: {
                minifyJS: true,
                minifyCSS: true,
                removeAttributeQuotes: true //压缩 去掉引号
            }
        }),
        new webpack_1.default.HotModuleReplacementPlugin()
    ]
});
//# sourceMappingURL=dev.config.js.map