找到Webpack配置文件,但在切换webpack版本后没有配置条目

时间:2017-06-27 10:30:20

标签: javascript webpack

以下webpack.config.js文件

var path = require("path");
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin");

module.exports = function(env) {return {
    entry: {
        "project1": "./project1/src/index.js",
        "project2": "./project2/src/index.ts"
    },
    output: {
        filename: "[name].bundle.js",
        path: env.output_path
    },
    externals: [
        "angular",
        "uuid",
        {
            "lodash": {
                commonjs: "lodash",
                amd: "lodash",
                root: "_" // indicates global variable
            }
        },
        {
            "jquery-ui": {
                amd: "jquery-ui",
                commonjs: 'jquery-ui'
            }
        },
        {
            "jquery": {
                root: "$",
                amd: "jquery",
                commonjs: 'jquery'
            }
        },
        {
            "Slick": {
                root: "Slick",
                amd: "Slick",
                commonjs: 'Slick'
            }
        }
    ],
    devtool: 'source-map',
    resolve: {
        // Add `.ts` and `.tsx` as a resolvable extension.
        extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                use: ['ts-loader']
            },
            {
                test: /\.html$/,
                use: ['html-loader']
            }
        ]
    }
};
};

在以前版本的webpack下完美运行。更新到最新版本后,我收到错误

  

找到了Webpack配置文件,但未配置任何条目

我该如何解决?

0 个答案:

没有答案