2020-02-14 14:37:12 -08:00
|
|
|
const webpack = require('webpack'),
|
|
|
|
path = require('path'),
|
2022-12-23 13:27:08 -08:00
|
|
|
{CleanWebpackPlugin} = require('clean-webpack-plugin'),
|
2020-02-14 14:37:12 -08:00
|
|
|
CopyWebpackPlugin = require('copy-webpack-plugin'),
|
2020-02-14 15:07:50 -08:00
|
|
|
WebpackExtensionManifestPlugin = require('webpack-extension-manifest-plugin');
|
2020-02-14 14:37:12 -08:00
|
|
|
|
|
|
|
const T = {
|
|
|
|
CHROME : 'chrome',
|
|
|
|
FIREFOX: 'firefox',
|
|
|
|
};
|
|
|
|
|
2022-12-27 18:50:32 -08:00
|
|
|
|
|
|
|
// TODO will be conditional on T.CHROME at some point
|
|
|
|
const v3 = false
|
|
|
|
|
2020-02-14 14:37:12 -08:00
|
|
|
const env = {
|
2022-12-29 19:48:59 -08:00
|
|
|
TARGET : process.env.TARGET,
|
|
|
|
RELEASE: process.env.RELEASE,
|
|
|
|
PUBLISH: process.env.PUBLISH,
|
|
|
|
}
|
|
|
|
const ext_id = process.env.EXT_ID
|
2019-01-06 05:42:54 -08:00
|
|
|
|
|
|
|
const pkg = require('./package.json');
|
|
|
|
const baseManifest = require('./src/manifest.json');
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
|
2020-02-14 14:37:12 -08:00
|
|
|
const release = env.RELEASE == 'YES' ? true : false;
|
2022-12-23 12:58:26 -08:00
|
|
|
const publish = env.PUBLISH == 'YES' ? true : false;
|
2020-02-14 14:37:12 -08:00
|
|
|
const dev = !release; // meh. maybe make up my mind?
|
2019-01-28 15:41:15 -08:00
|
|
|
const target = env.TARGET;
|
2019-01-18 16:41:27 -08:00
|
|
|
|
2020-02-14 14:37:12 -08:00
|
|
|
const name = "grasp" + (dev ? ' [dev]' : '');
|
2019-01-16 13:43:57 -08:00
|
|
|
|
2022-12-23 21:29:44 -08:00
|
|
|
|
|
|
|
// ugh. declarative formats are shit.
|
|
|
|
|
2019-06-29 09:37:31 -07:00
|
|
|
// Firefox wouldn't let you rebind its default shortcuts most of which use Shift
|
|
|
|
// On the other hand, Chrome wouldn't let you use Alt
|
2022-12-23 21:29:44 -08:00
|
|
|
const modifier = target === T.CHROME ? 'Shift' : 'Alt'
|
2019-06-29 09:37:31 -07:00
|
|
|
|
2022-12-27 18:50:32 -08:00
|
|
|
const action_name = v3 ? 'action' : 'browser_action'
|
2022-12-23 21:29:44 -08:00
|
|
|
|
|
|
|
const commands = {
|
2019-06-29 09:37:31 -07:00
|
|
|
"capture-simple": {
|
2022-12-23 21:29:44 -08:00
|
|
|
"description": "Quick capture: url, title and selection",
|
2019-06-29 09:37:31 -07:00
|
|
|
"suggested_key": {
|
|
|
|
"default": `Ctrl+${modifier}+C`,
|
2022-12-23 21:29:44 -08:00
|
|
|
"mac": `Command+${modifier}+C`,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
commands[`_execute_${action_name}`] = {
|
|
|
|
"description": "Capture page, with extra information",
|
2019-06-29 09:37:31 -07:00
|
|
|
"suggested_key": {
|
|
|
|
"default": `Ctrl+${modifier}+Y`,
|
2022-12-23 21:29:44 -08:00
|
|
|
"mac": `Command+${modifier}+Y`,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const action = {
|
|
|
|
"default_icon": "img/unicorn.png",
|
|
|
|
"default_popup": "popup.html",
|
|
|
|
"default_title": "Capture page, with extra information",
|
|
|
|
}
|
|
|
|
if (target == T.FIREFOX) {
|
|
|
|
action['browser_style'] = true
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-12-28 12:45:06 -08:00
|
|
|
const endpoints = (domain) => [
|
|
|
|
"http://" + domain + "/capture",
|
|
|
|
"https://" + domain + "/capture",
|
2022-12-23 21:29:44 -08:00
|
|
|
]
|
|
|
|
|
2022-12-28 12:45:06 -08:00
|
|
|
|
|
|
|
// prepare for manifest v3
|
|
|
|
const host_permissions = endpoints('localhost')
|
|
|
|
const optional_host_permissions = endpoints('*')
|
|
|
|
|
2022-12-23 21:29:44 -08:00
|
|
|
|
2020-02-14 14:37:12 -08:00
|
|
|
// TODO make permissions literate
|
|
|
|
const permissions = [
|
|
|
|
"storage",
|
|
|
|
"notifications",
|
2022-12-23 21:29:44 -08:00
|
|
|
|
|
|
|
// need to query active tab and get its url/title
|
|
|
|
"activeTab",
|
|
|
|
]
|
|
|
|
|
2022-12-27 18:50:32 -08:00
|
|
|
|
|
|
|
const optional_permissions = []
|
|
|
|
|
2022-12-29 19:48:59 -08:00
|
|
|
if (target === T.FIREFOX || v3) {
|
|
|
|
// chrome v2 doesn't support scripting api
|
|
|
|
// code has a fallback just for that
|
|
|
|
// (needed to get selected text)
|
|
|
|
permissions.push("scripting")
|
2022-12-23 21:29:44 -08:00
|
|
|
}
|
2020-02-14 14:37:12 -08:00
|
|
|
|
|
|
|
|
2022-12-28 12:45:06 -08:00
|
|
|
const content_security_policy = [
|
|
|
|
"default-src 'self'",
|
|
|
|
"connect-src " + endpoints('*:*').join(' '),
|
|
|
|
|
|
|
|
// FFS, otherwise <style> directives on extension's pages not working??
|
|
|
|
"style-src 'unsafe-inline'",
|
|
|
|
].join('; ')
|
|
|
|
|
|
|
|
|
2019-01-28 15:41:15 -08:00
|
|
|
const manifestExtra = {
|
2020-02-14 14:37:12 -08:00
|
|
|
name: name,
|
2019-01-28 15:41:15 -08:00
|
|
|
version: pkg.version,
|
|
|
|
description: pkg.description,
|
|
|
|
permissions: permissions,
|
2022-12-23 21:29:44 -08:00
|
|
|
commands: commands,
|
|
|
|
optional_permissions: optional_permissions,
|
2022-12-27 18:50:32 -08:00
|
|
|
manifest_version: v3 ? 3 : 2,
|
|
|
|
background: (v3 ? {
|
|
|
|
service_worker: 'background.js',
|
2022-12-29 19:48:59 -08:00
|
|
|
// wtf -- firefox doesn't support module??
|
|
|
|
// it just fails to load manifest in this case atm
|
|
|
|
...(target === T.FIREFOX? {} : {type: 'module'}),
|
2022-12-27 18:50:32 -08:00
|
|
|
} : {
|
|
|
|
scripts: [
|
2022-12-29 17:47:26 -08:00
|
|
|
'webextension-polyfill.js',
|
2022-12-27 18:50:32 -08:00
|
|
|
'background.js',
|
|
|
|
],
|
|
|
|
persistent: false,
|
|
|
|
}),
|
2022-12-28 12:45:06 -08:00
|
|
|
content_security_policy: v3 ? {
|
|
|
|
extension_pages: content_security_policy,
|
|
|
|
} : content_security_policy,
|
2022-12-23 21:29:44 -08:00
|
|
|
}
|
|
|
|
manifestExtra[action_name] = action
|
|
|
|
|
2022-12-27 18:50:32 -08:00
|
|
|
if (v3) {
|
|
|
|
manifestExtra['host_permissions'] = host_permissions
|
|
|
|
manifestExtra['optional_host_permissions'] = optional_host_permissions
|
2022-12-29 19:48:59 -08:00
|
|
|
if (target === T.FIREFOX) {
|
|
|
|
manifestExtra['browser_specific_settings'] = {
|
|
|
|
"gecko": {
|
|
|
|
"id": ext_id,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2022-12-27 18:50:32 -08:00
|
|
|
} else {
|
|
|
|
manifestExtra.permissions.push(...host_permissions)
|
|
|
|
manifestExtra.optional_permissions.push(...optional_host_permissions)
|
|
|
|
}
|
|
|
|
|
2019-01-16 13:43:57 -08:00
|
|
|
|
2020-02-14 14:37:12 -08:00
|
|
|
if (target === T.FIREFOX) {
|
2019-01-28 15:41:15 -08:00
|
|
|
manifestExtra.options_ui = {browser_style: true};
|
|
|
|
}
|
2019-01-16 13:43:57 -08:00
|
|
|
|
2022-12-23 12:58:26 -08:00
|
|
|
const buildPath = path.join(__dirname, 'dist', target);
|
2019-12-09 12:43:38 -08:00
|
|
|
|
2020-02-14 15:07:50 -08:00
|
|
|
const options = {
|
|
|
|
mode: dev ? 'development' : 'production', // TODO map directly from MODE env var?
|
2022-12-23 12:58:26 -08:00
|
|
|
node: {
|
|
|
|
// no idea what does it mean... https://github.com/webpack/webpack/issues/5627#issuecomment-394290231
|
|
|
|
// but it does get rid of some Function() which webpacka apparently generates
|
|
|
|
global: false,
|
2019-12-09 13:11:07 -08:00
|
|
|
},
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
entry: {
|
2020-02-14 15:07:50 -08:00
|
|
|
background : path.join(__dirname, "src", "js", "background"),
|
|
|
|
popup : path.join(__dirname, "src", "js", "popup"),
|
|
|
|
options_page: path.join(__dirname, "src", "js", "options_page"),
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
},
|
|
|
|
output: {
|
2022-12-23 12:58:26 -08:00
|
|
|
path: buildPath,
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
},
|
2022-12-23 12:58:26 -08:00
|
|
|
optimization: {
|
|
|
|
// https://webpack.js.org/configuration/optimization
|
|
|
|
// don't think minimize worth it for such a tiny extension
|
2022-12-29 17:47:26 -08:00
|
|
|
minimize: false,
|
|
|
|
|
|
|
|
// split chunks is so vendors split out into separate js files
|
|
|
|
// to prevent bloating individual source files
|
|
|
|
// seems that at the moment we need to manually load the chunks in the corresponding
|
|
|
|
// html files or manifest
|
|
|
|
// split chunks doc recommend using webpack html plugin??
|
|
|
|
splitChunks: {
|
|
|
|
// seems necessary, otherwise doesn't split out polyfill??
|
|
|
|
chunks: 'all',
|
|
|
|
cacheGroups: {
|
|
|
|
vendor: {
|
|
|
|
test: /[\\/]node_modules[\\/]/,
|
|
|
|
name(module) {
|
|
|
|
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
|
|
|
|
return packageName
|
|
|
|
},
|
|
|
|
// create chunk regardless size etc
|
|
|
|
enforce: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-12-23 12:58:26 -08:00
|
|
|
},
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
module: {
|
|
|
|
rules: [
|
2019-01-04 13:27:24 -08:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2022-12-23 14:34:37 -08:00
|
|
|
loader: 'babel-loader',
|
2019-01-04 13:27:24 -08:00
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
{
|
2022-12-23 14:34:37 -08:00
|
|
|
test: /\.css$/,
|
|
|
|
use: 'style-loader!css-loader',
|
|
|
|
exclude: /node_modules/,
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
2022-12-23 14:34:37 -08:00
|
|
|
loader: 'html-loader',
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
exclude: /node_modules/
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
2022-12-23 13:27:08 -08:00
|
|
|
new CleanWebpackPlugin(), // ok, respects symlinks
|
2022-12-23 14:34:37 -08:00
|
|
|
|
|
|
|
// without copy pluging, webpack only bundles js/json files
|
2022-12-23 13:27:08 -08:00
|
|
|
new CopyWebpackPlugin({
|
|
|
|
patterns: [
|
2022-12-23 14:34:37 -08:00
|
|
|
{ context: 'src', from: '**/*.html' },
|
|
|
|
{ context: 'src', from: '**/*.png' },
|
2022-12-23 13:27:08 -08:00
|
|
|
]
|
|
|
|
}),
|
2019-01-06 05:42:54 -08:00
|
|
|
new WebpackExtensionManifestPlugin({
|
|
|
|
config: {
|
|
|
|
base: baseManifest,
|
2019-01-28 15:41:15 -08:00
|
|
|
extend: manifestExtra,
|
2019-01-06 05:42:54 -08:00
|
|
|
}
|
|
|
|
}),
|
2022-12-28 12:45:06 -08:00
|
|
|
],
|
|
|
|
// docs claim it's the slowest but pretty fast anyway
|
|
|
|
devtool: 'source-map',
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
}
|
|
|
|
|
2022-12-28 12:45:06 -08:00
|
|
|
|
Collapse boilerplate in a single commit
First prototype
Added the README
Fixed the hot module replacement
Minor adjustments on readme
Normalizing the env vars and using it capitalized
Added info about the react.js branch
Fix babel transpiling
Using yarn
Removing the babel package, just the babel-core does the job
Using just the dependencies key on package.json
Since it isn't a lib package doesn't matter the separation between
devDependencies and dependencies.
Updating the css-loader
Updating the fs-extra
Moving the utility packages to utils folder
Better description
Adds the license
closes #3
Write the env vars on the bundle file
http://dev.topheman.com/make-your-react-production-minified-version-with-webpack/
Fixs the hot reload setup
Sringifies the env object to define plugin
Uses the webpack html plugin to generate the pages in a less hacky way
Uses the write-file-webpack-plugin
this plugin allows the webpack write on disk all files, even running
with the webserver, which is necessary to the hot reload.
this plugin also help us to remove nasty hacks and expose bundles to
other extension features.
Allows exclude some entry points to be hot reloaded
It's useful for content scripts that can't keep the connection with the
webpack endpoint.
Updates the webpack
Updates the README with instructions about the content scripts
resolves #4
Updates to Webpack 2
closes #8
Expand the DefinePlugin usage
In Webpack 1, the replaced value at compile time by define plugin was placed with
parenthesis, like ({"NODE_ENV":"development","PORT":3000}), now, it not works in
this way, breaking the app.
So, to simplify the things, this commit just passes the NODE_ENV var.
Fix README
Exclude /node_modules/ from babel and css transpiling #9
Source maps to help debugging
closes #10
Removes the forbidden webpack config 'chromeExtensionBoilerplate'
before build and webserver's start
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
#9
Update README.md
Removing babel.js
Basically, we don't need transpiling with babel since Webpack 2 take care of
ES6 modules transpiling and the ES2015 is supported by Chrome.
kudos @gagarine
resolve #16
Setup boilerplate to load images and other assets in html and css
resolves #18
resolves #23
resolves #14
resolves #12
Added icons and images boilerplate
Split dependencies on package.json
resolves #15
Webpack config improvements (#26)
- Use CopyWebpackPlugin to generate `manifest.json` file
- Use CleanWebpackPlugin to clear build folder
Minor README adjustments
* explicitly the required node version
* pointing to yarn install instructions page instead suggest install
with npm. the yarn page will be always updated to the best way to install
the yarn.
closes #28
Adding the contribution guidelines
2016-04-14 06:16:50 -07:00
|
|
|
module.exports = options;
|