Skip to content

Commit

Permalink
Merge pull request #24 from armateam/tusbar/local-fontawesome
Browse files Browse the repository at this point in the history
Use font-awesome locally
  • Loading branch information
tusbar authored Feb 7, 2017
2 parents bb2b5ca + ad60276 commit 5aa9c15
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 18 deletions.
4 changes: 2 additions & 2 deletions extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

"background": {
"scripts": [
"dist/common.js",
"dist/background.js"
"/dist/scripts/common.js",
"/dist/scripts/background.js"
]
},

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"author": "Bertrand Marron",
"license": "ISC",
"dependencies": {
"font-awesome": "^4.7.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
Expand All @@ -36,6 +37,7 @@
"eslint": "^3.15.0",
"eslint-plugin-react": "^6.9.0",
"extract-text-webpack-plugin": "beta",
"file-loader": "^0.10.0",
"html-webpack-plugin": "^2.28.0",
"json-loader": "^0.5.4",
"less": "^2.7.2",
Expand Down
1 change: 0 additions & 1 deletion src/popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
* {
box-sizing: border-box;
Expand Down
45 changes: 39 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
// ## //

const production = process.env.NODE_ENV === 'production';
const etp = new ExtractTextPlugin({
filename: '[name].css'
});

let plugins = [
new webpack.DefinePlugin({
Expand Down Expand Up @@ -43,7 +40,9 @@ let plugins = [
name: 'common'
}),

etp
new ExtractTextPlugin({
filename: 'style/[name].css'
})
];

if (production) {
Expand All @@ -58,6 +57,7 @@ const config = {
entry: {
popup: [
'babel-polyfill',
'font-awesome/css/font-awesome.css',
'./src/popup'
],

Expand All @@ -69,7 +69,8 @@ const config = {

output: {
path: 'extension/dist',
filename: '[name].js'
filename: 'scripts/[name].js',
publicPath: '/dist/'
},

module: {
Expand All @@ -82,9 +83,41 @@ const config = {
}
},

{
test: /\.(eot|svg|ttf|woff2?)(\?.*$|$)/,
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]'
}
},

{
test: /\.css/,
loader: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
options: {
sourceMap: !production
}
},

{
loader: 'postcss-loader',
options: {
plugins: () => ([
require('postcss-focus')(),
require('postcss-cssnext')()
])
}
}
]
})
},

{
test: /\.less/,
loader: etp.extract({
loader: ExtractTextPlugin.extract({
use: [
{
loader: 'css-loader',
Expand Down
21 changes: 12 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,13 @@ ajv@4.10.4:
co "^4.6.0"
json-stable-stringify "^1.0.1"

ajv@^4.11.2:
ajv@^4.11.2, ajv@^4.7.0:
version "4.11.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.2.tgz#f166c3c11cbc6cb9dcc102a5bcfe5b72c95287e6"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"

ajv@^4.7.0:
version "4.10.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.0.tgz#7ae6169180eb199192a8b9a19fd0f47fc9ac8764"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"

align-text@^0.1.1, align-text@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
Expand Down Expand Up @@ -2338,6 +2331,12 @@ file-entry-cache@^2.0.0:
flat-cache "^1.2.1"
object-assign "^4.0.1"

file-loader@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.10.0.tgz#bbe6db7474ac92c7f54fdc197cf547e98b6b8e12"
dependencies:
loader-utils "~0.2.5"

filename-regex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775"
Expand Down Expand Up @@ -2413,6 +2412,10 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"

font-awesome@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133"

for-in@^0.1.5:
version "0.1.6"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8"
Expand Down Expand Up @@ -3267,7 +3270,7 @@ loader-runner@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"

loader-utils@^0.2.11, loader-utils@^0.2.16, loader-utils@^0.2.5, loader-utils@~0.2.2:
loader-utils@^0.2.11, loader-utils@^0.2.16, loader-utils@^0.2.5, loader-utils@~0.2.2, loader-utils@~0.2.5:
version "0.2.16"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d"
dependencies:
Expand Down

0 comments on commit 5aa9c15

Please sign in to comment.