简体   繁体   中英

Some issue with webpack resolving

I trying to setup my small app using webpack. OS Debian. When I try to compile and build project by "webpack" I receive this: http://pastebin.com/gpwkebuq and I don't know why. File app.js exist in folder "frontend". I saw that this error met many peoples, solution for this task for them was different, but no one solves my problem

This is my webpack.config.js

const webpack = require('webpack');

module.exports = {
context: __dirname + '/frontend',
entry: {
    app: "./app"
},

output: {
    path: __dirname + '/public',
    filename: "[name].js",
},
watch: true,
watchOptions: {
    aggregateTimeout: 100
},

devtool: "cheap-inline-module-source-map",

plugins: [
],

module: {
    loaders: [{
        test: /\.js$/,
        loader: 'babel'
    }]
},

resolve: {
    moduleDirectories: ['node_modules'],
    extensions: ['', '.js']
},

resolveLoader: {
    moduleDirectories: ['node_modules'],
    moduleTemplates: ['*-loader', '*'],
    extensions: ['', '.js']
},
};

This is my package.json: http://pastebin.com/pCSCm9VA Structure of my project:

-anotherproj
   -frontend
       -app.js
       -login.js
   -node_modules
   -public
   -webpack.config.js
   -package.json

Update the entry to

entry: {
    app: "./app.js"
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM