-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bcd9bc
commit 331634d
Showing
14 changed files
with
2,158 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ | |
"sinon": true, | ||
"module": true, | ||
"beforeEach": true, | ||
"inject": true | ||
"inject": true, | ||
"__dirname": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
const CleanWebpackPlugin = require('clean-webpack-plugin'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
const ExtractTextPluginLight = new ExtractTextPlugin('./css/grafana-zabbix.light.css'); | ||
const ExtractTextPluginDark = new ExtractTextPlugin('./css/grafana-zabbix.dark.css'); | ||
|
||
function resolve(dir) { | ||
return path.join(__dirname, '..', dir); | ||
} | ||
|
||
module.exports = { | ||
target: 'node', | ||
context: resolve('src'), | ||
entry: { | ||
'./module': './module.js', | ||
'components/config': './components/config.js', | ||
'datasource-zabbix/module': './datasource-zabbix/module.js', | ||
'panel-triggers/module': './panel-triggers/module.js', | ||
}, | ||
output: { | ||
filename: "[name].js", | ||
path: resolve('dist'), | ||
libraryTarget: "amd" | ||
}, | ||
externals: [ | ||
// remove the line below if you don't want to use builtin versions | ||
'jquery', 'lodash', 'moment', 'angular', | ||
'react', 'react-dom', | ||
function (context, request, callback) { | ||
var prefix = 'grafana/'; | ||
if (request.indexOf(prefix) === 0) { | ||
return callback(null, request.substr(prefix.length)); | ||
} | ||
callback(); | ||
} | ||
], | ||
plugins: [ | ||
new webpack.optimize.OccurrenceOrderPlugin(), | ||
new CopyWebpackPlugin([ | ||
{ from: 'plugin.json' }, | ||
{ from: '**/*.html' }, | ||
{ from: 'dashboards/*' }, | ||
{ from: '../README.md' }, | ||
{ from: '**/img/*' }, | ||
]), | ||
new CleanWebpackPlugin(['dist'], { | ||
root: resolve('.') | ||
}), | ||
ExtractTextPluginLight, | ||
ExtractTextPluginDark, | ||
], | ||
resolve: { | ||
extensions: [".js", ".html", ".scss"] | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /(external)/, | ||
use: { | ||
loader: 'babel-loader', | ||
query: { | ||
presets: [ | ||
require.resolve('babel-preset-env') | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
test: /\.html$/, | ||
use: { | ||
loader: 'html-loader' | ||
} | ||
}, | ||
{ | ||
test: /\.light\.scss$/, | ||
use: ExtractTextPluginLight.extract({ | ||
fallback: 'style-loader', | ||
use: ['css-loader', 'sass-loader'] | ||
}) | ||
}, | ||
{ | ||
test: /\.dark\.scss$/, | ||
use: ExtractTextPluginDark.extract({ | ||
fallback: 'style-loader', | ||
use: ['css-loader', 'sass-loader'] | ||
}) | ||
}, | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const baseWebpackConfig = require('./webpack.base.conf'); | ||
|
||
var conf = baseWebpackConfig; | ||
conf.watch = true; | ||
conf.mode = 'development'; | ||
conf.devtool = 'source-map'; | ||
|
||
module.exports = baseWebpackConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const baseWebpackConfig = require('./webpack.base.conf'); | ||
const NgAnnotatePlugin = require('ng-annotate-webpack-plugin'); | ||
|
||
var conf = baseWebpackConfig; | ||
conf.mode = 'production'; | ||
conf.plugins.push(new NgAnnotatePlugin()); | ||
|
||
module.exports = baseWebpackConfig; |
Oops, something went wrong.