Skip to content

Commit

Permalink
Fix bundling issue with node modules
Browse files Browse the repository at this point in the history
The web-ext `build` task (bundling for Firefox) seems to ignore
`node_modules` folders. Since we rely on shipping a node module
dependency, the bundled addon missed a dependency and was therefore
broken. This commit resolves that issue by renaming the node_modules
folder.
  • Loading branch information
jaylinski committed Jun 4, 2019
1 parent ca704c5 commit ad5430f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kodi/echo",
"version": "0.2.0",
"version": "0.2.1",
"description": "Browser Extension for sharing content with Kodi.",
"keywords": [
"kodi",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fs.mkdirSync('./build');

// Copy files.
console.log('Copying source files ...');
glob('./src/**/*.*', { ignore: './src/node_modules/**/*' }, (error, files) => {
glob('./src/**/*.*', { ignore: './src/modules/npm/**/*' }, (error, files) => {
files.map((src) => {
const dest = src.replace('/src/', '/build/');
mkdirSyncP(path.dirname(dest));
Expand All @@ -54,7 +54,7 @@ console.log('Copying node modules ...');
node_modules.map((module) => {
glob(`./node_modules/${module}/**/*.js`, {}, (error, files) => {
files.map((src) => {
const dest = src.replace('/node_modules/', '/build/node_modules/');
const dest = src.replace('/node_modules/', '/build/modules/npm/');
mkdirSyncP(path.dirname(dest));
fs.createReadStream(src).pipe(fs.createWriteStream(dest));
});
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Echo for Kodi",
"version": "0.2.0",
"version": "0.2.1",
"description": "__MSG_extensionDescription__",
"homepage_url": "https:/jaylinski/kodi-echo",
"content_security_policy": "default-src 'self'; connect-src ws:; style-src 'self' 'unsafe-inline'",
Expand Down
1 change: 1 addition & 0 deletions src/modules/npm
2 changes: 1 addition & 1 deletion src/modules/utils/dom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html as litTaggedTemplateLiteral, render as litRender } from './../../node_modules/lit-html/lit-html.js';
import { html as litTaggedTemplateLiteral, render as litRender } from './../npm/lit-html/lit-html.js';

/**
* Tagged template literal for rendering.
Expand Down
1 change: 0 additions & 1 deletion src/node_modules

This file was deleted.

0 comments on commit ad5430f

Please sign in to comment.