UNPKG

1.98 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.tpl_webpack_common = void 0;
4var utils_1 = require("@omni-door/utils");
5var tpl = "`${use_strict}\n\nconst path = require('path');\nconst WebpackBar = require('webpackbar');\nconst { VueLoaderPlugin } = require('vue-loader');\n\nconst cliConfig = require(path.resolve(__dirname, '${configFileName}'));\nconst hash = cliConfig && cliConfig.build && cliConfig.build.hash;\n\n\nmodule.exports = {\n stats: 'errors-warnings',\n module: {\n rules: [\n {\n test: /.vue$/,\n loader: 'vue-loader'\n },\n {\n test: ${ts ? /\\.(js|jsx|ts|tsx)$/ : /\\.(js|jsx)$/},\n use: [\n {\n loader: 'babel-loader',\n options: {\n configFile: path.resolve(__dirname, 'babel.config.js')\n }\n }\n ]\n },\n {\n test: /\\\\.(woff|woff2|eot|ttf|svg|jpg|png|gif)$/,\n use: [\n {\n loader: 'url-loader',\n options: {\n limit: 8192,\n name: hash ? \\`assets/[name].[\\${typeof hash === 'string' ? hash : 'contenthash'}:8].[ext]\\` : 'assets/[name].[ext]'\n }\n }\n ]\n }\n ],\n },\n plugins: [\n new VueLoaderPlugin(),\n new WebpackBar({\n name: '[OMNI-DOOR]:'\n })\n ],\n resolve: {\n alias: {\n '@': path.resolve(__dirname, '../src'),\n '@pages': path.resolve(__dirname, '../src/pages'),\n '@components': path.resolve(__dirname, '../src/components')\n },\n extensions: ['.vue', ${ts ? \"'.ts', '.tsx', \" : ''}'.js', '.jsx', ${style ? (style === 'css' ? \"'.css'\" : (style === 'less' ? \"'.less', '.css'\" : style === 'scss' ? \"'.scss', '.css', '.sass'\" : \"'.scss', '.less', '.css', '.sass'\")) : ''}]\n }\n};\n`";
6exports.tpl_webpack_common = {
7 tpl: tpl
8};
9exports.default = utils_1.tplEngineInit(exports.tpl_webpack_common, 'tpl');