mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
webpack config
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
const webpack = require("webpack");
|
||||
const path = require("path");
|
||||
|
||||
const config = {
|
||||
context: path.resolve(__dirname, "assets/static"),
|
||||
entry: "./unsee.js",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "assets/static/dist"),
|
||||
publicPath: "../static/dist/",
|
||||
filename: "bundle.js"
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
$: "jquery",
|
||||
jQuery: "jquery"
|
||||
})
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: require.resolve("jquery"),
|
||||
use: "expose-loader?$!expose-loader?jQuery"
|
||||
},
|
||||
{
|
||||
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
use: "url-loader?limit=10000&mimetype=application/font-woff"
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
use: "file-loader"
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: "style-loader"
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: "style-loader"
|
||||
},
|
||||
{
|
||||
test: /\.less$/,
|
||||
use: [
|
||||
{ loader: "style-loader" },
|
||||
{ loader: "css-loader" },
|
||||
{ loader: "less-loader" }
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: path.resolve(__dirname, "assets/static"),
|
||||
use: [ {
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
presets: [
|
||||
[ "es2015", { modules: false } ]
|
||||
]
|
||||
}
|
||||
} ]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
Reference in New Issue
Block a user