Giter Club home page Giter Club logo

Comments (15)

eoinoc avatar eoinoc commented on June 14, 2024 11

The fix is here:

#16 (comment)

Edit webpack.base.js

From:

plugins: [
  htmlPage('popup', 'popup', ['popup']),  
  htmlPage('background', 'background', ['background']),  
  ...  
]

To:

plugins: [
  htmlPage('popup', 'popup', ['manifest', 'vendor', 'popup']),  
  htmlPage('background', 'background', ['manifest', 'vendor', 'background']),  
  ...  
]

from vue-chrome-extension-template.

ALiangLiang avatar ALiangLiang commented on June 14, 2024 6

Have same problem. It's fine in dev script but it happens in build script.


I has no knowledge about how Webpack work too. But I found a workaround. Add manifest.js and verdor.js to every pages.
ex.

<!-- add below two js before target js file -->
  <script type="text/javascript" src="/js/manifest.js"></script></body>
  <script type="text/javascript" src="/js/vendor.js"></script></body>
  <script type="text/javascript" src="/js/background.js?688071810bcfb2f5e4b6"></script></body>
<!-- add below two js before target js file -->
  <script type="text/javascript" src="/js/manifest.js"></script></body>
  <script type="text/javascript" src="/js/vendor.js"></script></body>
  <script type="text/javascript" src="/js/popup.js?688071810bcfb2f5e4b6"></script></body>

from vue-chrome-extension-template.

kkinder avatar kkinder commented on June 14, 2024 3

Adding those to the content/popup files works for them, but not for the injected js.

from vue-chrome-extension-template.

HaoweiCh avatar HaoweiCh commented on June 14, 2024 2

No clue for inject.js?

from vue-chrome-extension-template.

operari avatar operari commented on June 14, 2024 1

Мда если русский берется - то никогда до конца, до ума дело не доведет. Мне уже надоело мучаться со всеми возникшими проблемами. Расширение готово, но не работает из-за кривой сборки. Спасибо!

from vue-chrome-extension-template.

IgorBasov avatar IgorBasov commented on June 14, 2024 1

Мда если русский берется - то никогда до конца, до ума дело не доведет. Мне уже надоело мучаться со всеми возникшими проблемами. Расширение готово, но не работает из-за кривой сборки. Спасибо!

Держите себя в руках, сударь. Вам здесь никто и ничего не должен!
А Ваши суждения попахивают шовинизмом, а потому недостойны нормального человека.
Извинитесь!

from vue-chrome-extension-template.

tldrjumps avatar tldrjumps commented on June 14, 2024

Workaround:

  • Remove first one of the commonsChunkPlugin will work on webpack.prod.js
    I suspect the same, it might be the Webpack.js must be chunk into specific .js, Sorry zero knowledge about how Webpack work.

from vue-chrome-extension-template.

yaadyaad avatar yaadyaad commented on June 14, 2024

The fix of ALiangLiang works fine. Thanks a lot!

from vue-chrome-extension-template.

austince avatar austince commented on June 14, 2024

Here are some good resources I've found but haven't quite figured out yet:
https://github.com/szrenwei/inline-manifest-webpack-plugin/tree/v3.0.1
webpack/webpack#959
jantimon/html-webpack-plugin#143
webpack/webpack#368

from vue-chrome-extension-template.

hkd987 avatar hkd987 commented on June 14, 2024

@ALiangLiang where exactly are you injecting the script tags? Think we could make this clear for future people looking to solve this issue.

from vue-chrome-extension-template.

wilderchen avatar wilderchen commented on June 14, 2024

Adding those to the content/popup files works for them, but not for the injected js.

Do you have any idea to make it work for the injected js?

from vue-chrome-extension-template.

hkd987 avatar hkd987 commented on June 14, 2024

#21

I went ahead and submitted this for a pull

edit: I see that it probably will not be published since this repo seems to no longer be maintained.

from vue-chrome-extension-template.

kevinpiac avatar kevinpiac commented on June 14, 2024

Hey guys, @HaoweiCh,

A workaround for inject.js I found is to comment/remove CommonChunkPlugin from webpack.prod file.

/// ............ webpack.prod.js
  new ExtractTextPlugin({
      filename: 'css/[name].[contenthash].css'
    }),
    new webpack.HashedModuleIdsPlugin(),
    // 
    // new webpack.optimize.CommonsChunkPlugin({
    //   name: 'vendor',
    //   minChunks: function (module) {
    //     return (
    //       module.resource &&
    //       /\.js$/.test(module.resource) &&
    //       module.resource.indexOf(
    //         path.join(__dirname, '../node_modules')
    //       ) === 0
    //     )
    //   }
    // }),
    // new webpack.optimize.CommonsChunkPlugin({
    //   name: 'manifest',
    //   chunks: ['vendor']
    // })

The reason is explained here: webpack/webpack#368

Note: commenting/removing might not be the perfect solution but it works for me without causing an issue.

from vue-chrome-extension-template.

operari avatar operari commented on June 14, 2024

Держите себя в руках, сударь. Вам здесь никто и ничего не должен!
А Ваши суждения попахивают шовинизмом, а потому недостойны нормального человека.
Извинитесь!

Извините)))

from vue-chrome-extension-template.

operari avatar operari commented on June 14, 2024

@IgorBasov

Если серьезно. Вы упрекаете меня в шовинизме, хотя делите людей на достойных и недостойных.
Вы говорите что никто никому ничего не должен, хотя просите, чтобы я за что-то извинился.
Извинился за Ваши суждения отклонёнными когнитивными искажениями.
Мои же суждения - это обычная реакция экспрессиониста.

from vue-chrome-extension-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.