webpack 4-简单的设置,如何

时间:2018-08-20 15:12:56

标签: webpack

我在使用webpack 4时遇到了非常大的问题,我真的找不到很好的方法来使用它,因此,真的,真的向您询问帮助。从理论上讲,它可以毫无错误地工作,但毫无用处。白页。即使我不确定如何运行它。本地主机:8080?什么都不给只是页面的路径?相同。不同的端口?我在哪里找到它?

我已经安装了webpack和webpack-cli。 我有webpack.config.js:

create table my_table(code int); -- or bigint
insert into my_table values (123451233);

with input_data(input_code) as (
    values('1234512')
)

select t.*
from my_table t
cross join input_data
where left(code::text, length(input_code)) = input_code;

   code    
-----------
 123451233
(1 row) 

在package.json中,我有:

module.exports = {
    module: {
      rules: [
        {
            test: /\.(html)$/,
            use: ["html-loader"]
        }
      ]
    }
};

我有index.js

  "scripts": {
    "start": "webpack --mode development --watch",
    "build": "webpack --mode production"
  },

我的index.html:

var loginpage = Vue.component('login-page', require('./components/login-page/login-page.js'));


$(function() {
  var app = new Vue({
    el: '#app',
    data: function(){
      return {
          name: 'main components'
      }
    },
    methods: {},
    watch: {},
    created: function(){}
  });
// end
})

当然也存在登录组件。

然后我键入npm start webpack start,没有错误:

  
    

webpack-模式开发--watch

  
     

webpack正在监视文件…

     

哈希:e907caf25a8fe69c6097版本:webpack 4.12.2时间:内置768ms   于:2018-08-20 22:53:24资产规模大块大块   名称main.js 5.29 KiB main [emited] main [./src/index.js] 327   字节{主要} [内置]       + 2个隐藏模块

但随后我打开了localhost:8080

  

ERR_CONNECTION_REFUSED

我做错了什么?请帮助。

0 个答案:

没有答案