Comments (15)
The fix is here:
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.
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.
Adding those to the content/popup files works for them, but not for the injected js.
from vue-chrome-extension-template.
No clue for inject.js?
from vue-chrome-extension-template.
Мда если русский берется - то никогда до конца, до ума дело не доведет. Мне уже надоело мучаться со всеми возникшими проблемами. Расширение готово, но не работает из-за кривой сборки. Спасибо!
from vue-chrome-extension-template.
Мда если русский берется - то никогда до конца, до ума дело не доведет. Мне уже надоело мучаться со всеми возникшими проблемами. Расширение готово, но не работает из-за кривой сборки. Спасибо!
Держите себя в руках, сударь. Вам здесь никто и ничего не должен!
А Ваши суждения попахивают шовинизмом, а потому недостойны нормального человека.
Извинитесь!
from vue-chrome-extension-template.
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.
The fix of ALiangLiang works fine. Thanks a lot!
from vue-chrome-extension-template.
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.
@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.
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.
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.
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.
Держите себя в руках, сударь. Вам здесь никто и ничего не должен!
А Ваши суждения попахивают шовинизмом, а потому недостойны нормального человека.
Извинитесь!
Извините)))
from vue-chrome-extension-template.
Если серьезно. Вы упрекаете меня в шовинизме, хотя делите людей на достойных и недостойных.
Вы говорите что никто никому ничего не должен, хотя просите, чтобы я за что-то извинился.
Извинился за Ваши суждения отклонёнными когнитивными искажениями.
Мои же суждения - это обычная реакция экспрессиониста.
from vue-chrome-extension-template.
Related Issues (20)
- How to generate Vue in content.js? HOT 3
- There is no localhost address on cli HOT 3
- [Suggestion] Include a library for state managment HOT 1
- Response code 404 (Not Found) HOT 2
- Trying to publish in chrome using this template will get your extension rejected HOT 4
- Trying to build to install on Chrome HOT 6
- hot-reload error / wcer HOT 6
- I was wondering if vue-router works with chrome extension? HOT 1
- npm run dev failing HOT 3
- Single-file components and async/await HOT 1
- Build error websocket HOT 6
- components not work
- How to interact with page elements HOT 1
- Webpack fails when testing extension HOT 3
- How to split js file into small files? HOT 1
- Packages out of date
- npm run dev error HOT 8
- I can't make it dev/build HOT 2
- Content script loaded twice HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-chrome-extension-template.